Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
michael_asamoah
New Member

Calculation error in measure: DAX comparison values of type Text with values of type Number.

Hi 

I am trying to do a Year on Year % change, but i keep getting an error. It cannot load the data for this visual. The full error message is: MdxScript(Model) (146,94) Calculation error in measure: DAX comparison values of type Text with values of type Number. Consider the VALUE or FORMAT function to convert one of the values. 

 

The script i am using:

 

YOY Deposit Count % Change =
VAR LastYear =
CALCULATE(
SUM('Summaryv1'[Count Deposits]),
FILTER(ALLEXCEPT('Summaryv1','Summaryv1'[Site Name],'Summaryv1'[Current VIP Status]),FORMAT(Summaryv1[Date Formatted],"General Number")=fORMAT(FIRSTNONBLANK(Summaryv1[Year],Summaryv1[Year]),"General Number")-1)
)
VAR ThisYear = SUM('Summaryv1'[Count Deposits])
RETURN
(ThisYear-LastYear)/LastYear

 

If any one has any ideas as to how to get this working, i would be most grateful. 

2 REPLIES 2
Bs25
Frequent Visitor

Hi i'm trying to do filtered calculations for which i created a measure but its not working . I have tried changing the types of columns, still nor esult 

Couldn't load the data for this visual

MdxScript(Model) (14, 52) Calculation error in measure 'Sheet1 Measure 15: DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values

 

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @michael_asamoah,

 

This is a little confusing if we just see it literally. Actually Format returns a string. Please refer to this documentation. I would suggest using Value instead or changing the format to numerical type directly.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.