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

 

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,810)