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
saud968
Super User
Super User

Dax Studio Error

Hi 

I am getting the below error as per the screenshot 

saud968_1-1736253826567.png
Actual error 

Correlation Id: 45e64fd5-8acd-738e-e54d-c8610e9ec64d Error Details: Failed to get the column type at index 0 from the data reader. Column count: 19. Existing columns: [ID,TableID,Name,Description,DataType,Expression,FormatString,IsHidden,State,ModifiedTime,StructureModifiedTime,KPIID,IsSimpleMeasure,ErrorMessage,DisplayFolder,DetailRowsDefinitionID,DataCategory,LineageTag,SourceLineageTag]


I am not sure how do I fix this issue, please assist. 

@lbendlin@Greg_Deckler @Ashish_Mathur 

@Ahmedx 



 

16 REPLIES 16
BeaBF
Super User
Super User

@saud968 Hi! The $SYSTEM.TMSCHEMA_MEASURES system view retrieves metadata about measures in your data model. Since the error mentions "Failed to get the column type at index 0," it suggests an issue with either the structure or data type of the first column (ID).
Try to do:
SELECT ID FROM $SYSTEM.TMSCHEMA_MEASURES
what do you obtain?

BBF

I know $SYSTEM.TMSCHEMA_MEASURES gets the measures and that's what I want to do. 

I get below error when I use SELECT ID FROM $SYSTEM.TMSCHEMA_MEASURES

Query (1, 11) The syntax for 'FROM' is incorrect. (SELECT ID FROM $SYSTEM.TMSCHEMA_MEASURES).

@saud968 Try with:
EVALUATE
SELECTCOLUMNS(
$SYSTEM.TMSCHEMA_MEASURES,
"ID", [ID],
"Name", [Name]
)

BBF

Got this error


Correlation Id: d9b7762b-f21e-1048-e33e-ca558a36c08e
Error Details: Query (3, 1) The syntax for 'TMSCHEMA_MEASURES' is incorrect. (EVALUATE
SELECTCOLUMNS(
$SYSTEM.TMSCHEMA_MEASURES,
"ID", [ID],
"Name", [Name]
)).

@saud968 Sorry, try with:
EVALUATE
SELECTCOLUMNS(
$SYSTEM.TMSCHEMA_MEASURES,
"MeasureID", $SYSTEM.TMSCHEMA_MEASURES[ID],
"MeasureName", $SYSTEM.TMSCHEMA_MEASURES[Name]
)

BBF


Correlation Id: d9b7762b-f21e-1048-e33e-ca558a36c08e
Error Details: Query (4, 39) The syntax for '[ID]' is incorrect. (EVALUATE
SELECTCOLUMNS(
$SYSTEM.TMSCHEMA_MEASURES,
"MeasureID", $SYSTEM.TMSCHEMA_MEASURES[ID],
"MeasureName", $SYSTEM.TMSCHEMA_MEASURES[Name]
)).

Got the above error

@saud968 ok, so let's debug the code to see the error.

Run a simple query to inspect the column names in $SYSTEM.TMSCHEMA_MEASURES:

EVALUATE
$SYSTEM.TMSCHEMA_MEASURES

 

and paste the result.

 

BBF


Correlation Id: d9b7762b-f21e-1048-e33e-ca558a36c08e
Error Details: Query (2, 1) The syntax for 'TMSCHEMA_MEASURES' is incorrect. (EVALUATE
$SYSTEM.TMSCHEMA_MEASURES).

@saud968 if you try with only 
EVALUATE
TMSCHEMA_MEASURES?

 

BBF


Correlation Id: d9b7762b-f21e-1048-e33e-ca558a36c08e
Error Details: Query (2, 1) Failed to resolve name 'TMSCHEMA_MEASURES'. It is not a valid table, variable, or function name.

@saud968 Can you paste a screen of your view in Dax Studio? on the left you should have the view and the measures, try to drag and drop the view or the measure into the code box. 

 

BBF 

saud968_0-1736323259500.png

Here is the screenshot

@saud968 and a screen of the data model

 

BBF

saud968_0-1736338117013.png

here it is 

 

@saud968 ok, so in the EVALUATE expression, you need to use the Table Name in this Data Model. Try for example: 

EVALUATE Bookings. it will work. You need to use the Table Name of the Model.

 

BBF

saud968_1-1736342398432.png

These are my measure table

 

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