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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors