Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Data Segmentation based on price ifference

Hi,

 

I am currently trying to segment soe product sales in to groups. Let me explain..

I have a table of products with a MIN price and a MAX price and a dax formular calculating the pricedifference in % MAX/(MAX-MIN). Also an additional table called PriceClasses with the columns ClassName, MIN, MAX.

 

PriceClasses

NameMINMAX
<10%00,1
10-20%0,10,2

 

In a line chart I want to show e.g.  the amount of products that belong to each group by day. basically on the 16th of august there were 50 Products between 10-20% and 10 products below 10 % and so on

The dax formular I have looks like this:

 

Price difference Classes =
VAR RankingDimension = VALUES('AllCountries(Combined)'[EAN])

RETURN
Calculate([Price difference %],FILTER(RankingDimension, COUNTROWS(FILTER(PriceClasses,[Price difference %]> PriceClasses[Min] && [Price difference %]<= PriceClasses[Max]))))
 
I cannot get the linechart to show the amount of products(counted rows). So I assume that the dax is incorect?
 

 

can somebody help out on this? 

4 Replies

  • Anonymous , I think it should be like

    Calculate([Price difference %],FILTER(RankingDimension, [Price difference %]> PriceClasses[Min] && [Price difference %]<= PriceClasses[Max]))

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I think I cannot access and utilize the MIN MAX columns of the Pricess classes through this ? 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Does somebody have an idea on this? 🙂

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    Can you provide a full data in a pbix, including both sample tables and the relationship. And if you put the 16 Aug on the x axis, the visual will only show values on a same vertical line. So I am not sure how is your expected visual looks like.

     

     

    Paul Zheng _ Community Support Team