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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

create date column based on condition

Hi,

i have the following table

 

Create date             status

19-03-2019            Follow-up in 3 months

20-01-2019            badfit

21-03-2019            Follow-up in 1 month    

 

am having the status values like  follow_up in 1 month, 2 month, 3 month etc,

if status followup inmonth then expected date need to come=[ createdate(3* 30days) ]

if status followup in 6 month then expected date need to come=[ createdate(6*30days) ]

 

i expect following  table

 

Create date             status                                     Expected date

19-03-2019            Follow-up in 3 months            19-05-2019

20-01-2019            badfit                                       

21-03-2019            Follow-up in 1 month              21-04-2019

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

 Hi @Anonymous 

 

Firstly, create measures Follow_up Month to extract the month number, an then create measures Date1, Expected date to meet your demand.

 

Follow_up Month = VALUE(if((MID(SELECTEDVALUE(Table1[status]),14,1))="",0,MID(SELECTEDVALUE(Table1[status]),14,1)))

 

Date1 =

var d = max(Table1[Create date])

return DATE(YEAR(d),MONTH(d)+Table1[Follow_up Month],day(d))

 

Expected date = IF(SELECTEDVALUE(Table1[status])="badfit"," ",Table1[Date1])

 

Then, choose table visual to display the result.

 

2.png 

 

 

 

Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EXgLDtZ8H4pMr8r9kZOeXXIBAdViPGR3iOeCAM9XsnQYcg?e=KfbXay

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xicai
Community Support
Community Support

 Hi @Anonymous 

 

Firstly, create measures Follow_up Month to extract the month number, an then create measures Date1, Expected date to meet your demand.

 

Follow_up Month = VALUE(if((MID(SELECTEDVALUE(Table1[status]),14,1))="",0,MID(SELECTEDVALUE(Table1[status]),14,1)))

 

Date1 =

var d = max(Table1[Create date])

return DATE(YEAR(d),MONTH(d)+Table1[Follow_up Month],day(d))

 

Expected date = IF(SELECTEDVALUE(Table1[status])="badfit"," ",Table1[Date1])

 

Then, choose table visual to display the result.

 

2.png 

 

 

 

Here is my test pbix: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EXgLDtZ8H4pMr8r9kZOeXXIBAdViPGR3iOeCAM9XsnQYcg?e=KfbXay

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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