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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi
Hope someone can help me with this.
I've created the following measure to calculate Cost as 2 products have bulk cost rules.
This works perfectly for me in my table visual. But because I've used the MAX function for the text, the total of this column is way off. What's a way to get around this?
Or is there a better way to have written this statement?
Thanks
[Total Sales] is a measure.
Total Cost =
IF([Total Sales] <= 3729 && MAX('Product Table'[Product Type])="A", [Total Sales]*232.20 ,
IF(MAX('Product Table'[Product Type])="A", 3729*232.20 + ([Total Sales]-3729)*241.92,
IF([Total Sales]<= 185 && MAX('Product Table'[Product Type])="B", [Total Sales]*333.24,
IF(MAX('Product Table'[Product Type])="B", 185*333.24 + ([Total Sales]-185)*399.24,
[Total Sales]*MAX('Product'[Cost])
))))
Please refer to this solution https://community.powerbi.com/t5/Desktop/Total-isn-t-being-calculated-correctly/m-p/2890211
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series
Hi @ribisht17
I have tried the link you sent through. I am not sure how my calculation can be flipped to include the bulk cost rules.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.