Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, i have multiple conditions, how is this doable in power bi?
IF
([SCHEDULE_SHIP_DATE] < TODAY() OR [SCHEDULE_SHIP_DATE] < TODAY() + 2)
THEN 'Today'
ELSEIF ([SCHEDULE_SHIP_DATE] < TODAY() OR
[SCHEDULE_SHIP_DATE] < TODAY() + 2 OR
[SCHEDULE_SHIP_DATE] < TODAY() + 6)
THEN 'N5D'
ELSEIF ([SCHEDULE_SHIP_DATE] < TODAY() + 13)
THEN 'N2W'
END
Hi @Anonymous ,
You could try SWITCH() function.
https://docs.microsoft.com/en-us/dax/switch-function-dax
However, the second condition look wired.
([SCHEDULE_SHIP_DATE] < TODAY() OR [SCHEDULE_SHIP_DATE] < TODAY() + 2) could be both "Today" and "N5D"?
Best Regards,
Jay
Hi @Anonymous ,
You can use below code:-
column =
IF (
OR ( [SCHEDULE_SHIP_DATE] < TODAY (), [SCHEDULE_SHIP_DATE] < TODAY () + 2 ),
"Today",
IF (
OR (
[SCHEDULE_SHIP_DATE] < TODAY (),
OR (
[SCHEDULE_SHIP_DATE]
< ( TODAY () + 2 ),
[SCHEDULE_SHIP_DATE]
< ( TODAY () + 6 )
)
),
"N5D",
IF ( [SCHEDULE_SHIP_DATE] < ( TODAY () + 13 ), "N2W" )
)
)
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
hi @Samarth_18 the formula you suggested seems to not be working on the output i desire.
this formula:
is actually the reference to be used, i want to modify that formula into a new classification:
New Column (DESIRED OUTPUT):
N5D will cover all "Backlog" , "N5D", "Today"
Today will cover "Backlog","Today"
Future will be "N2W"
For your first condition i.e. N5D will cover all "Backlog" , "N5D", "Today", if SSD = N5D then it will show N5D but it will show N5D for backlog and today as well since we have applied OR condition. N5D and Today cant go in parellel in such case. Could you please check if we are missing any other condition?
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
75 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |