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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.