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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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