Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |