Forum Discussion
Table Total not calculating correctly
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])
))))
2 Replies
- ribisht17
Super User
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- AnonymousNot applicable
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.