Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rubulsahu
Frequent 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 image. First I  have to filter on status and then based on values calculate the Assessmrt outcome value. Its very tricky for me and hoping someone could guide me in the right direction.Picture1.png

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@rubulsahu Use a SWITCH(TRUE()...) statement like:

 

Column = 
  SWITCH(TRUE(),
    [Global Assessment Outcome] <> BLANK(), [Global Assessment Outcome],
    [Triage Outcome] <> "Select One", [Triage Outcome],
    [PreImpAss Outcome] = "SELECT ONE", "NA",
    [PreImpAss Outcome]
  )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler Thankyou so much for the prompt response. But I have to first filter Status Value(col 1) . How I can include If with Switch? 

When Status is cancelled then Cancelled

When Status in(

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

) then

Switch

@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"
)​


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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. 

@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.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.