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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

MdxScript(Model) (16, 72)

Hi Forum, 

 

i'm having this issue. Just want to highlight that this file is the copy of a previous one, with the same measure and same parametres. The only difference is that in the latest copy queries are fed from a Sharepoint location.

 

have a look:

 

MdxScript(Model) (16, 72) Calculation error in measure 'QF Pricing (ALL)'[QF Trade Ups]: 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.

 

the measure is:

 

Current_Price_QF =
CALCULATE (
MIN ( 'QF Pricing (ALL)'[AIF]),
LASTNONBLANK (
DATESBETWEEN ( 'Date'[Date], BLANK (), LASTDATE ( 'Date'[Date] ) ),
CALCULATE ( COUNT ( 'QF Pricing (ALL)'[AIF] ) )
)
)

 

 

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

you mentioned source is now SharePoint files - could the switch affect the data types for columns? or maybe some new data was added that doesn't meet the data types? e.g. some comment below a table in Excel etc.


I assume the error is about the FILTER criteria, 'FBC and RBD Map (Core)'[Tariff Level] has some values that are not numbers and calculation breaks for them. 
if that's the case the calculation below will give an error that VALUE cannot convert some values to numbers - the fix would be to remove non numeric values from that column

QF Trade Ups =
VAR myindex=
selectedvalue('FBC and RBD Map (Core)'[Tariff Level])
return
[Current_Price_QF]
-CALCULATE([Current_Price_QF],FILTER(ALL('FBC and RBD Map (Core)'),VALUE('FBC and RBD Map (Core)'[Tariff Level])=VALUE(myindex)-1)
)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
Stachu
Community Champion
Community Champion

you posted syntax for [Current_Price_QF], while error message mentions 'QF Pricing (ALL)'[QF Trade Ups], can you post that syntax as well?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

QF Trade Ups =
VAR myindex=
selectedvalue('FBC and RBD Map (Core)'[Tariff Level])
return
[Current_Price_QF]
-CALCULATE([Current_Price_QF],FILTER(ALL('FBC and RBD Map (Core)'),'FBC and RBD Map (Core)'[Tariff Level]=myindex-1)
)

Stachu
Community Champion
Community Champion

you mentioned source is now SharePoint files - could the switch affect the data types for columns? or maybe some new data was added that doesn't meet the data types? e.g. some comment below a table in Excel etc.


I assume the error is about the FILTER criteria, 'FBC and RBD Map (Core)'[Tariff Level] has some values that are not numbers and calculation breaks for them. 
if that's the case the calculation below will give an error that VALUE cannot convert some values to numbers - the fix would be to remove non numeric values from that column

QF Trade Ups =
VAR myindex=
selectedvalue('FBC and RBD Map (Core)'[Tariff Level])
return
[Current_Price_QF]
-CALCULATE([Current_Price_QF],FILTER(ALL('FBC and RBD Map (Core)'),VALUE('FBC and RBD Map (Core)'[Tariff Level])=VALUE(myindex)-1)
)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.