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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
UNIheve
Frequent Visitor

DAX query error handling

Hi

Is it possible to error handle a case, where the measure [b] doesnt exist in the model?

 

DEFINE
VAR a = [b]
EVALUATE
{a}

 

@Greg_Deckler 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Not currently possible. If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41

View solution in original post

2 REPLIES 2
UNIheve
Frequent Visitor

@lbendlin Thanks. I will vote 🙂

 

Cause yes, it is important.
I query multiple SSAS cubes (dev-test-prod) automatically via users acceptance criteria, that is, some values from measures, that the user states as correct in a certain filter context.
From the users input in validated Excel sheets, DAX evaluation strings are constructed to return a calculatede value like  DEFINE var a = CALCULATE ( <meausure>, <filtercontext> ) EVALUATE {a}. The calculated value is then compared with the expected value.
If the measure eg. is not yet in production, I dont want the evaluation to fail.
Not being able to error handle, I must load and join with all measure metadata from all cubes (20 at the moment) to test if the measure is present.

 

lbendlin
Super User
Super User

Not currently possible. If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com/?forum=2d80fd4a-16cb-4189-896b-e0dac5e08b41

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors