cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jvgga96
Frequent Visitor

Filter two results in a powerapps chart

Hello everyone!

Happy new year!

I'm trying to build a column chart where I will only have two results from filters using combobox. I was able to filter only one of the options using the following code:
Filter(TableC_1,Dimension in ComboBoxDimension.SelectedItems, Brand in ComboBoxBrand.SelectedItems, Name in ComboBoxName.SelectedItems, Power in ComboBoxPower.SelectedItems , Material in ComboBoxMaterial.SelectedItems).
In this chart, I will compare the performance of two different products.

The product 2 is filtered in the same way, with ComboBoxDimension2, ComboBoxBrand2, ... .

Can someone help me to put these two products on the same chart to compare them?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Jvgga96 :

Could you tell me:

  • Is there a number column named "performance" in TableC_1?

If so,you could try :

Table(
    {
        Product: "Product1",
        Number: Lookup(TableC_1,Dimension in ComboBoxDimension.SelectedItems, Brand in ComboBoxBrand.SelectedItems, Name in ComboBoxName.SelectedItems, Power in ComboBoxPower.SelectedItems , Material in ComboBoxMaterial.SelectedItems).performance
    },
    {
        Product: "Product2",
        Number: Lookup(TableC_1,Dimension in ComboBoxDimension2.SelectedItems, Brand in ComboBoxBrand2.SelectedItems, Name in ComboBoxName2.SelectedItems, Power in ComboBoxPower2.SelectedItems , Material in ComboBoxMaterial2.SelectedItems).performance
    }
)

or

Table(
    {
        Product: "Product1",
        Number: Sum(Filter(TableC_1,Dimension in ComboBoxDimension.SelectedItems, Brand in ComboBoxBrand.SelectedItems, Name in ComboBoxName.SelectedItems, Power in ComboBoxPower.SelectedItems , Material in ComboBoxMaterial.SelectedItems),performance)
    },
    {
        Product: "Product2",
        Number: Sum(Filter(TableC_1,Dimension in ComboBoxDimension2.SelectedItems, Brand in ComboBoxBrand2.SelectedItems, Name in ComboBoxName2.SelectedItems, Power in ComboBoxPower2.SelectedItems , Material in ComboBoxMaterial2.SelectedItems),performance)
    }
)

Best Regards,

Bof

 

View solution in original post

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

Hi @Jvgga96 :

I'm not sure what the value you want to represent, I assume you want to compare the number of records after product 1 and product 2 Filter.Please try:

Table(
    {
        Product: "Product1",
        Number: CountRows(Filter(TableC_1,Dimension in ComboBoxDimension.SelectedItems, Brand in ComboBoxBrand.SelectedItems, Name in ComboBoxName.SelectedItems, Power in ComboBoxPower.SelectedItems , Material in ComboBoxMaterial.SelectedItems))
    },
    {
        Product: "Product2",
        Number: CountRows(Filter(TableC_1,Dimension in ComboBoxDimension2.SelectedItems, Brand in ComboBoxBrand2.SelectedItems, Name in ComboBoxName2.SelectedItems, Power in ComboBoxPower2.SelectedItems , Material in ComboBoxMaterial2.SelectedItems))
    }
)

Best Regards,

Bof

Jvgga96
Frequent Visitor

Hi @v-bofeng-msft , Thank you for your answer. 

 

In fact, I want to compare the performance of two different products that are in my database. All these Comboboxs are to filter two products, as you can see in the image. 

 

After the filter, I will click on the "report" and the chart will appear. In the chart, I want the product name to appear on the lable and the value being the performance of each product. In my code, I was able to select only one product, as you can see in the second image.

 

With your code, I was able to select both Products but with the number of records and not the performance, as you can see in the third image. 

Can you help me to build a chart where the Product1 and Product2 will be selected with the filters and will show the performance of each product? I think that we are almost there.

Jvgga96_0-1609868382384.png

 

 

Jvgga96_1-1609868456872.png

 

Jvgga96_3-1609868509710.png

 

 

 



v-bofeng-msft
Community Support
Community Support

Hi @Jvgga96 :

Could you tell me:

  • Is there a number column named "performance" in TableC_1?

If so,you could try :

Table(
    {
        Product: "Product1",
        Number: Lookup(TableC_1,Dimension in ComboBoxDimension.SelectedItems, Brand in ComboBoxBrand.SelectedItems, Name in ComboBoxName.SelectedItems, Power in ComboBoxPower.SelectedItems , Material in ComboBoxMaterial.SelectedItems).performance
    },
    {
        Product: "Product2",
        Number: Lookup(TableC_1,Dimension in ComboBoxDimension2.SelectedItems, Brand in ComboBoxBrand2.SelectedItems, Name in ComboBoxName2.SelectedItems, Power in ComboBoxPower2.SelectedItems , Material in ComboBoxMaterial2.SelectedItems).performance
    }
)

or

Table(
    {
        Product: "Product1",
        Number: Sum(Filter(TableC_1,Dimension in ComboBoxDimension.SelectedItems, Brand in ComboBoxBrand.SelectedItems, Name in ComboBoxName.SelectedItems, Power in ComboBoxPower.SelectedItems , Material in ComboBoxMaterial.SelectedItems),performance)
    },
    {
        Product: "Product2",
        Number: Sum(Filter(TableC_1,Dimension in ComboBoxDimension2.SelectedItems, Brand in ComboBoxBrand2.SelectedItems, Name in ComboBoxName2.SelectedItems, Power in ComboBoxPower2.SelectedItems , Material in ComboBoxMaterial2.SelectedItems),performance)
    }
)

Best Regards,

Bof

 

View solution in original post

Thank you, @v-bofeng-msft ! 

 

The second option worked very well, thanks. 

 

Could you help me with a second point?

 

With this code, on my label appears "Product1" and "Product2". I would like the name of the products selected in ComboboxBrand and ComboBoxBrand_1 to appear.

 

Could you help me with that? 

 

Best Regards. 

 

Jvgga96_0-1609955221015.png

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,040)