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?
Solved! Go to Solution.
Hi @Jvgga96 :
Could you tell me:
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
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
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.
Hi @Jvgga96 :
Could you tell me:
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.
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |