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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Calculations using the measures I created.

Hello,

I have data like the following,and created a measure called price.

キャプチャ.PNG

 

*price =

DIVIDE([Sales],[Qty])

Then, to categorize this price
I created a DAX for the price range like this
 
*Pricerange = IF(AND([price]>=1, [tprice]<=10),"1-10",
IF(AND([price]>=11, [price]<=20),"11-20",
IF(AND([price]>=21, [price]<=30),"21-30",
IF([Productprice]>1000,"1000+", BLANK())
)))))))

I'd like to use this measure to determine the total price of a $10 product,  $20 product, and so on.

I've created such a DAX, but it does not work
*
Amount_1-10 =
CALCULATE([sales],[pricerange]="1-10")
 
Any solution for this?

1 REPLY 1
lbendlin
Super User
Super User

you probably need to expand the filter context to include the entire table, not just the current row.

 

By the way, your price range bucketing can be done a little simpler via SWITCH(TRUE(),...)

 

Pricerange =SWITCH(TRUE(),[Price]<=10),"1-10",[Price]<=20),"11-20",[Price]<=30),"21-30",...,"1000+")
 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.