Forum Discussion
Markzolotoy
Impactful Individual
3 years agoRun DAX expression conditionally
Let's say I have the following expression:
EVALUATE SUMMARIZECOLUMNS('RealTimeServiceTypeSummary'[PointCount], 'RealTimeServiceTypeSummary'[RealTimeServiceTypeName])
This expression is a query for a dateset. What I want is to run it conditionally meaning it either returns data or not doesn't event run.
Thanks
Markzolotoy try this:
DEFINE VAR __RunQuery = FALSE () --set value to TRUE () if you want to run the query EVALUATE SUMMARIZECOLUMNS( 'RealTimeServiceTypeSummary'[PointCount], 'RealTimeServiceTypeSummary'[RealTimeServiceTypeName], FILTER ( 'RealTimeServiceTypeSummary', __RunQuery ) )
2 Replies
- parry2k
Super User
Markzolotoy try this:
DEFINE VAR __RunQuery = FALSE () --set value to TRUE () if you want to run the query EVALUATE SUMMARIZECOLUMNS( 'RealTimeServiceTypeSummary'[PointCount], 'RealTimeServiceTypeSummary'[RealTimeServiceTypeName], FILTER ( 'RealTimeServiceTypeSummary', __RunQuery ) ) - Greg_Deckler
Community Champion
Markzolotoy Under what condition would it not run?