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

Measure works on workspace DB but not on Deployed Server

Can anybody provide possible reasons why a measure work on my local/workspace DB, but not a deployed server?

 

The error message in Power BI when using the measure from the deployed tabular database:

 

MdxScript(Model) (186, 59) Calculation error in measure function containsrow does not support comparing values of type text with values of type integer

 

We are using a tabular model.

TIA

 

2 REPLIES 2
Anonymous
Not applicable

I have managed to make a change that gets the measure to generate the correct value, but I still dont understand why the measure would not work in the one and not the other.

 

The following measure works (generates a value in a visual) on the workspace db on my local machine, but not on the deployed server.

 

VAR MaxVersion =
CALCULATE (
SELECTEDVALUE ( 'V_fact_OnlineVersion'[Version_Key] ),
'V_DIM_Version'[Version] = [Latest Version (with movement)]
)
VAR MaxStatus =
CALCULATE (
SELECTEDVALUE ( 'V_DIM_RequestStatus'[RequestStatus] ),
FILTER (
ALL ( 'V_fact_OnlineVersion' ),
'V_fact_OnlineVersion'[Request_Key] = 'V_fact_OnlineVersion'[Request_Key]
&& 'V_fact_OnlineVersion'[Version_Key] = MaxVersion
)
)
RETURN
MaxStatus


The same measure gives the following error when deployed on the deployed server and hence the visual does not generate:

nikilouwgmail_1-1692274413960.png

 



The measure error message says the following:

Expression: A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

By adding changing SELECTEDVALUE to MAX and adding FILTER ( ALL ( ... to the measure as follows, I get the measure to work on the deployed server:

VAR MaxVersion =
CALCULATE (
MAX ( 'V_fact_OnlineVersion'[Version_Key] ), FILTER ( ALL ( 'V_DIM_Version'[Version] )
'V_DIM_Version'[Version] = [Latest Version (with movement)]
)

Can somebody please explain this to me?

@ValtteriN 
@amitchandak 
@Anonymous @Anonymous @v-yueyunzh-msft 

ValtteriN
Super User
Super User

Hi,

It is likely your columns data type is "any" in the tabular db. When the data is loaded PQ will automatically determine data type for the column resulting in the error. 

E.g:

ValtteriN_0-1692194085362.png


Now when I manually change the data type this happens:

ValtteriN_1-1692194134157.png

 

ValtteriN_2-1692194157961.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.