Forum Discussion
SWITCH - 2 conditions
Hi,
I have created the following formula with SWITCH:
- 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.
5 Replies
- TheoCCommunity Champion
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 🙂
- AnonymousNot applicable
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.