Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi
I am getting the below error as per the screenshot
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
@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).
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
Here is the screenshot
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
These are my measure table