Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
dats
Resolver I
Resolver I

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?
 
PriceClassLinechart.png

 

can somebody help out on this? 

4 REPLIES 4
Anonymous
Not applicable

@dats 

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

dats
Resolver I
Resolver I

Does somebody have an idea on this? 🙂

amitchandak
Super User
Super User

@dats , I think it should be like

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

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.