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
Anonymous
Not applicable

How to create new conditional column based on dates with DAX in Power BI

I want to create a conditional column based on Seller column and Date column. I want to place a seller in a different unit. For example, seller named Joe was in S1 unit from January to March but then got migrated into S2 unit starting from April. But in the database, Joe is still in S1. I want to create a new column to segregate Joe into different unit.

 

Here is an example of the column (New Unit) that I want to create:

 

image.png

 

I'm having a trouble with dates and if else statements with DAX. Is there any other way that I can pull this off?

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

 

 

New Unit = IF( table[Date] < DATE(2019,4,1) && table[Seller] = "Joe", "S1" , table[Unit])

View solution in original post

1 REPLY 1
d_gosbell
Super User
Super User

 

 

New Unit = IF( table[Date] < DATE(2019,4,1) && table[Seller] = "Joe", "S1" , table[Unit])

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.