This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi all,
Using PBIDS 2.97 Sept, 2021.
I created a measure to get Total Sales By Profit Center - no errors in Meausre
However when I try to add it to a visual, I get an error:
Error Message:
MdxScript(Model) (8, 9) Calculation error in measure ' Measures'[Total Sales By Store]: Cannot convert value 'PC001' of type Text to type True/False.
My measure:
What am I doing wrong?
Thanks,
-w
Hi @UncleLewis
Thanks for reaching out to us.
Have you solved your problem with the above answers?
If not, could you share the code of [Total Sales]? This error usually occurs when you make a bool judgment on the value of text type.
Or try this,
Total Sales By Store =
CALCULATE ( SUM ( Sales[Sales] ), ALLEXCEPT ( Sales, Sales[Profit_Center] ) )
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
@UncleLewis not sure what you are trying to do, if I understood it correctly, you want to see total sales by profit center. As @AllisonKennedy recommended, you don't need to do anything since you already have a measure called Total Sales
In a table visual, drop Profit Center column and Total Sales measure and it should work.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@UncleLewis you can just use Profit Center in the visual you don't need a measure to do this unless you want the subtotal, in which case you need to use the ALL function:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 25 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 60 | |
| 48 | |
| 29 | |
| 23 | |
| 23 |