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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
js15
Helper I
Helper I

Troubleshooting DAX Query Error in Fabric

While executing a DAX query in a Fabric notebook, an error occurred. The query was intended to evaluate and select specific columns from the 'Inventory Item Coverage' table. The code snippet used is as follows:

query = """ 
EVALUATE
SELECTCOLUMNS(
'Inventory Item Coverage',

"Minimum", 'Inventory Item Coverage'[Minimum],

"Maximum", 'Inventory Item Coverage'[Maximum]
)
"""
df_inventory_coverage = fabric.evaluate_dax(query, workspace="ff252d1e-ac76-4df5-8a81-3ca36c28fb5f")

 Also, I tried this code as well, it does not work:

query = """

EVALUATE

SELECTCOLUMNS(

'Inventory Item Coverage',

"Minimum", 'Inventory Item Coverage'[Minimum],

"Maximum", 'Inventory Item Coverage'[Maximum]

)

"""

df_inventory_coverage = fabric.evaluate_dax(query, workspace="ff252d1e-ac76-4df5-8a81-3ca36c28fb5f")]
Here is the error posted: 
js15_0-1740679286999.png

 

 

 

Can someone help me verify if the table name 'Inventory Item Coverage' and the columns 'Minimum' and 'Maximum' are correctly referenced in my DAX query? Thanks
 
2 ACCEPTED SOLUTIONS
v-saisrao-msft
Community Support
Community Support

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. 

 

View solution in original post

TomMartens
Super User
Super User

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_daxquery

And an excerpt from the result:

TomMartens_0-1740725653512.png

 

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-pyt...

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

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_daxquery

And an excerpt from the result:

TomMartens_0-1740725653512.png

 

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-pyt...

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
v-saisrao-msft
Community Support
Community Support

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!

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.