Forum Discussion
Help with comparing all products
Hi!!!, i have a database (link: https://we.tl/t-QHZGDjbHgh ) and i would like to do all the posible comparisons of prices between Product X (i should be able to select the product i would like to compare) vs Product B, C, D and so on.
For example:
Average Price of product 1 vs Average price of product 2, Average Price of Product 1 vs Average Price of Product 3 and so on through all the combinations :).
Also it would be great to have a filter for each column that would let me compare for example all the products of banner spotter vs all the other products
or all the products of the brand hifi vs all the other products.
Thanks!!
- Anonymous5 years ago
Migscruz
You have many alternatives , but I guess the following report structure best matches your requirement. Check the pbix for detail.1. Create 2 separate tables as slicers
Name Table = DISTINCT('Table'[Name])Banner Table = DISTINCT('Table'[Banner])2. Create 2 measures to compare the average priceproduct compare =var selectedproduct = CALCULATE(SUM([ Average Price ]),FILTER(ALLSELECTED('Table'),[Name]=SELECTEDVALUE('Name Table'[Name])))Return selectedproduct-SUM('Table'[ Average Price ])banner compare =var selectedbanner =CALCULATE(SUM([ Average Price ]),FILTER(ALLSELECTED('Table'),[Banner]=SELECTEDVALUE('Banner Table'[Banner])))var rest_product = CALCULATE(SUM([ Average Price ]),FILTER(ALLSELECTED('Table'),[Banner]<>SELECTEDVALUE('Banner Table'[Banner])))Return selectedbanner - rest_productPaul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Migscruz
You have many alternatives , but I guess the following report structure best matches your requirement. Check the pbix for detail.1. Create 2 separate tables as slicers
Name Table = DISTINCT('Table'[Name])Banner Table = DISTINCT('Table'[Banner])2. Create 2 measures to compare the average priceproduct compare =var selectedproduct = CALCULATE(SUM([ Average Price ]),FILTER(ALLSELECTED('Table'),[Name]=SELECTEDVALUE('Name Table'[Name])))Return selectedproduct-SUM('Table'[ Average Price ])banner compare =var selectedbanner =CALCULATE(SUM([ Average Price ]),FILTER(ALLSELECTED('Table'),[Banner]=SELECTEDVALUE('Banner Table'[Banner])))var rest_product = CALCULATE(SUM([ Average Price ]),FILTER(ALLSELECTED('Table'),[Banner]<>SELECTEDVALUE('Banner Table'[Banner])))Return selectedbanner - rest_productPaul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.- Migscruz
Helper I
Thanks Anonymous it worked perfect!
Greetings