Forum Discussion

Migscruz's avatar
Migscruz
Icon for Helper I rankHelper I
5 years ago
Solved

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!!

  • Anonymous's avatar
    Anonymous
    5 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 price
    product 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_product
     

     

     

    Paul 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

  • Anonymous's avatar
    Anonymous
    Not 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 price
    product 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_product
     

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.

    • Migscruz's avatar
      Migscruz
      Icon for Helper I rankHelper I

      Thanks Anonymous it worked perfect!

       

      Greetings