Forum Discussion
Anonymous
3 years agoNot applicable
Switch DAX statement - If FALSE, return all rows
Hello, I'm trying to add a condition to my report that states if not Action type (filter) is applied, return all rows. Currently, I have a measure which recommends a specific action based on t...
Anonymous
3 years agoNot applicable
Thanks for your response FreemanZ !
Action measure is defined as:
ActionMeasure =
Action measure is defined as:
ActionMeasure =
switch(
True(),
Sum('Employee Leave Data'[Accrued Weeks]) >= 4
&& Sum('Employee Leave Data'[Accrued Weeks]) <= 5.99,
"Start Conversation",
Sum('Employee Leave Data'[Accrued Weeks]) >= 6
&& Sum('Employee Leave Data'[Accrued Weeks]) <= 7.99,
"Request Leave Plan",
Sum('Employee Leave Data'[Accrued Weeks]) >8,
"May be directed to take leave",
SUMX('Employee Leave Data', 'Employee Leave Data'[Accrued Leave (Hrs)]) >= 149
&& SUMX('Employee Leave Data', 'Employee Leave Data'[Accrued Leave (Hrs)]) <= 160,
"Monitor",
"No Action Required"
)
As to your second question, when I choose a filter it only returns those rows selected
With no filter applied, the visual breaks
however I would like the visual to return all results when no filter is applied, such as the below example
Thanks!
FreemanZ
Super User
3 years agohi Anonymous
try like:
Filter Status =
Var CurrentSelection = SELECTEDVALUE(ActOrd[Action])
Var CurrentAction = [ActionMeasure]
Return
Switch(
True(),
CurrentSelection = "Monitor" && CurrentAction = "Monitor",1,
CurrentSelection = "Start Conversation" && CurrentAction = "Start Conversation",1,
CurrentSelection = "Request Leave Plan" && CurrentAction = "Request Leave Plan",1,
CurrentSelection = "May be directed to take leave" && CurrentAction = "May be directed to take leave",1,
CurrentAction=BLANK(), 1,
0
)