Forum Discussion
rubulsahu
2 years agoFrequent Visitor
Need help to create below DAX command
HI All, I am very few to PowerBi and still catching up with its various commands. I have a complex requirement from business whereI have to calculate a new column using the formula defined in the...
Greg_Deckler
2 years agoCommunity Champion
rubulsahu Should be simple:
Column =
SWITCH(TRUE(),
[Status] = "Cancelled", "Cancelled",
[Global Assessment Outcome] <> BLANK(), [Global Assessment Outcome],
[Triage Outcome] <> "Select One", [Triage Outcome],
[PreImpAss Outcome] = "SELECT ONE", "NA",
[PreImpAss Outcome]
)
This assumes that all other values for Status should go through the rest of the evaluation process. If that is not the case then you could do this:
SWITCH(TRUE(),
[Status] = "Cancelled" || [Status] = "Administrative Update" || [Status] = "Global Cross-functional Impact Assessment in Progress", // add more or statements as necessary
SWITCH(TRUE(),
[Status] = "Cancelled", "Cancelled",
[Global Assessment Outcome] <> BLANK(), [Global Assessment Outcome],
[Triage Outcome] <> "Select One", [Triage Outcome],
[PreImpAss Outcome] = "SELECT ONE", "NA",
[PreImpAss Outcome]
),
"Something else"
)rubulsahu
2 years agoFrequent Visitor
HI Greg_Deckler
Thereare other values in the status apart from Cancelled and listed below
(
Administrative Update
Global Cross-functional Impact Assessment in Progress
Global Implementation Ongoing
Local Implementation Only (no Global Impact)
Local Implementation (Global Implementation Complete)
Completed PV Policy Activities)
I want to select only these for switch statement.
- Greg_Deckler2 years agoCommunity Champion
rubulsahu See edited post above. Again, if there are no other status other than those listed in the image then you can use the first version. Otherwise, you would use the revised version.