cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aidelsrkk Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User III
Super User III

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

 

 

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

View solution in original post

1 REPLY 1
Super User III
Super User III

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

 

 

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

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors