Forum Discussion
SWITCH - 2 conditions
- Anonymous2 years ago
Hii EsterBR ,
You can use this measure
Budget Q/Month =SWITCH (TRUE(),AND('Calendar'[Month Name] = "August", 'Calendar'[Month Name] = "September") , [Budget MAX],[Budget SUM])Similarly you can add other conditions also.Thankyou.
Hi EsterBR
You can modify it slightly by adding the SWITCH you have as a VAR, then adding another VAR for the special condition. For example:
Budget Q/Month =
VAR SelectedMonth = SELECTEDVALUE ( 'Calendar'[Month Name] )
VAR _Condition = // Add the condition here
RETURN
IF (
_Condition ,
// Calculation if _Condition is TRUE ,
SWITCH (
SelectedMonth ,
"August", [Budget MAX] ,
"September", [Budget MAX] ,
"October", [Budget MAX] ,
"November", [Budget MAX] ,
"December", [Budget MAX] ,
[Budget SUM]
)
)
I hope this makes sense / helps.
Theo 🙂