Forum Discussion
R_
8 years agoRegular Visitor
Nested If condition
Hi All, How to make nested if condition in Power BI. I have to create condition as : If (Amount is <=1000 and Year is MaxYear) , If(Amount is between <1000 and Year = MaxYe...
MFelix
8 years agoSuper User
Hi R_,
The best way is to use a SWITCH function something like this:
Period =
SWITCH (
TRUE (),
SUM ( Table[Amount] ) <= 1000
&& Date[Year] = MAX ( Date[Year] ), "Period",
SUM ( Table[Amount] ) < 1000
&& Date[Year]
= MAX ( Date[Year] ) - 1, "Period1",
SUM ( Table[Amount] ) < 1000
&& SUM ( Table[Amount] ) > 1000
&& Date[Year] = MAX ( Date[Year] ), "Period2",
...,
"ALL PERIOD"
)Regards,
MFelix