However, when I dragged this measure to canvas, cant display visual and the error message as follow:-
Error Message:
MdxScript(Model) (100, 10) Calculation error in measure ‘Key Measure’[Cumulative LYYTD-custom Wkly Sales]: DAX comparison operations do not support comparing values of type Text with values of type Number. Consider using the VALUE or FORMAT function to convert one of the values.
Please advise what went wrong and how to correct the measure. Thanks.
I wrote a measure for the growth of cumulative sales, ie cumulative sales TYYTD weekly sales - cumulative LYYTD weekly sales. When I displayed the result in table, it is fine. However, if I displayed the result in Card, it turned out blank as follow:-
My data model is Date in date table is linked to date in sales table. Do I need to build a relationship between New Week Num in date table to date in sales table in order for the result to be displayed in Card? Please advise. Thanks.
Hi Sam,
First, I would like to thank you for all that you do on here - amazing stuff that I’ve taken me from nowhere to somewhat intermediate Power BI user. I’ve been feeding off mostly from the questions you answer on this forum.
Question 1: My first measure works fine with the correct calculation per each line item including grand total but gives me incorrect number when displayed on a card visual.
First can you show me the grand total and the card so I can see the difference. It’s hard to know what could be happening without seeing the numbers. To me it would have to be something to do with the context of the results because they are basically exactly the same thing.
Also why is there a +0 at the end of the formulas?
Not sure why you have this.
Also direct query is notoriously bad when it comes to complex measures. Most just don’t even work.
There’s a few variables at play here so need to see more.
Here’s the table and the card visuals
The zeros at the end of the measure is for measure to return zero instead of blank where no data exist for a given location—don’t know of a better approach.
I am using direct query because there is over 50 million records in three of my tables. When I use Import mode and make a change in the query editor it takes endless time to update…I waited almost an hour one time while update is still running. The DirectQuery on the other hand takes about a minute or less. I’d preferred import mode to apply most of your techniques but only this limitation on my data size holding me up…Data stored in Azure.