Forum Discussion
Troubleshooting DAX Query Error in Fabric
- 1 year ago
Hi js15,
Thank you for reaching out to the Microsoft Fabric Community Forum.
You are encountering a TypeError when running your DAX query in a Fabric notebook. You are trying to retrieve the Minimum and Maximum columns from the 'Inventory Item Coverage' table using the SELECTCOLUMNS function.
- Ensure the "Inventory Item Coverage" table is present in your dataset and that the "Minimum" and "Maximum" columns are correctly referenced. You can verify this in Power BI or by using EVALUATE 'Inventory Item Coverage' to preview the table structure.
- If the table name includes spaces, enclose it in double quotes ("Inventory Item Coverage") rather than single quotes ('Inventory Item Coverage').
- The error message indicates that the function is missing the required dax_string argument. Please update your function call to include it: dax_string=query.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
- 1 year ago
Hey js15 ,
for me this looks as you missed the name of the semantic model in your evaluate_dax call.
This is a working example from one of my notebooks:
workspace_guid = "<the guid of my workspace>" DAX_querystring = """ EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS( 'Product'[Brand], "Sales Amount", CALCULATE([Sales Amount]), "Sales Amount Plan", CALCULATE([Sales Amount Plan]), "Sales Amount PY", CALCULATE([Sales Amount PY]) ) , 'Date'[Year] = 2024 ) """ df_daxquery = fabric.evaluate_dax( "learning Deneb - Contoso 1M - SQL Konferenz 2025", DAX_querystring, workspace_guid ) df_daxqueryAnd an excerpt from the result:
Here you will find the explanation of the evaluate_dax: https://learn.microsoft.com/en-us/python/api/semantic-link-sempy/sempy.fabric?view=semantic-link-python
Hopefully, this helps to tackle your challenge.
Regards,
Tom
Hi js15,
Thank you for reaching out to the Microsoft Fabric Community Forum.
You are encountering a TypeError when running your DAX query in a Fabric notebook. You are trying to retrieve the Minimum and Maximum columns from the 'Inventory Item Coverage' table using the SELECTCOLUMNS function.
- Ensure the "Inventory Item Coverage" table is present in your dataset and that the "Minimum" and "Maximum" columns are correctly referenced. You can verify this in Power BI or by using EVALUATE 'Inventory Item Coverage' to preview the table structure.
- If the table name includes spaces, enclose it in double quotes ("Inventory Item Coverage") rather than single quotes ('Inventory Item Coverage').
- The error message indicates that the function is missing the required dax_string argument. Please update your function call to include it: dax_string=query.
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Thank you, this really helps a lot!