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

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.

Reply
AlGrant
Frequent Visitor

New conditional Column based on two status columns in the same table

Hello,

 

I'm a new Powerbi user and am having issues creating a measure, any help would be appreciated.

 

Within a single table I have two columns for item status, one based on Migration Status and the other Decom Status.

 

I would like to create a new column called "Actual Program Status" based on the below criteria:

  • If Migration and Decom status are “Complete” = Complete
  • If migration status does not equal “not started” and decom is “Not started” = In Progress
  • If migration status is "Complete" and decom status is not ”Complete” = Decom Pending
  • If Migration Status is "Not Started" and Decom Status is "Not Started" then = Not Started

 

ItemMigration StatusDecom StatusActual Program Status
1CompleteCompleteComplete
2In ProgressNot StartedIn Progress
3CompleteNot StartedDecom Pending
4CompleteIn progressDecom Pending
5Not StartedNot StartedNot Started
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@AlGrant 

You can do that with a calcualted column using a SWITCH statement like this.

 

Actual Program Status = 
SWITCH ( 
    TRUE(),
    YourTable[Migration Status] = "Complete" && YourTable[Decom Status] = "Complete", "Complete",
    YourTable[Migration Status] <> "Not Started" && YourTable[Decom Status] = "Not Started", "In Progress",
    YourTable[Migration Status] = "Complete" && YourTable[Decom Status] <> "Complete", "Decom Pending",
    YourTable[Migration Status] = "Not Started" && YourTable[Decom Status] = "Not Started", "Not Started",
    "Other"
)

 

You would just need to change the name of the table to match your model.

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@AlGrant 

You can do that with a calcualted column using a SWITCH statement like this.

 

Actual Program Status = 
SWITCH ( 
    TRUE(),
    YourTable[Migration Status] = "Complete" && YourTable[Decom Status] = "Complete", "Complete",
    YourTable[Migration Status] <> "Not Started" && YourTable[Decom Status] = "Not Started", "In Progress",
    YourTable[Migration Status] = "Complete" && YourTable[Decom Status] <> "Complete", "Decom Pending",
    YourTable[Migration Status] = "Not Started" && YourTable[Decom Status] = "Not Started", "Not Started",
    "Other"
)

 

You would just need to change the name of the table to match your model.

Thanks you for your help @jdbuchanan71!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.