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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,385)