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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
chonchar
Helper V
Helper V

Days Between Dates

Hello,

 

I am trying to create a new column in a table called, "Days since started."

I am working off of a table named "Progress". I have two columns, one named "Start Date" and another called "Completion Date." 

 

I would like this column to calculate the following:

 

IF completion date is blank (no value inputed), I would like to return the value of (start date - today's date) (today's date must be dynamic for all days moving forward. ELSE there is a value in "completion date", I would like it be blank. 

Below is a sample of my data with an expected result. Please note that the "26" is what I would like to return, as there is no value in "completion date" and the blanks remain for the other three rows, as there is a completion date. 

chonchar_0-1696443181474.png

@parry2k @DataZoe @AlB Hopefully one of you can help. 

 

Best, 

 

Cam

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@chonchar try this:

 

New Columns = 
DATEDIFF ( Table[Start Date], COALESCE ( Table[Completion Date], TODAY () ), DAY )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Idrissshatila
Super User
Super User

Hello @chonchar ,

 

I was doing it but I was late I guess.

Days since started = IF('Table'[Completion Date] = BLANK() , DATEDIFF('Table'[Start date],TODAY(),DAY))

 

Idrissshatila_0-1696444560211.png

 

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Idrissshatila
Super User
Super User

Hello @chonchar ,

 

I was doing it but I was late I guess.

Days since started = IF('Table'[Completion Date] = BLANK() , DATEDIFF('Table'[Start date],TODAY(),DAY))

 

Idrissshatila_0-1696444560211.png

 

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




@parry2k @Idrissshatila 

 

Both work. Accordingly, both of you should have a solution credit for this post. Please verify.

 

Thank you both

 

chonchar_0-1696445026207.png

 

chonchar
Helper V
Helper V

@parry2k 

Thank you very much. You are always so great to work with. I appreicate you.

 

chonchar_0-1696444386705.png

 

parry2k
Super User
Super User

@chonchar try this:

 

New Columns = 
DATEDIFF ( Table[Start Date], COALESCE ( Table[Completion Date], TODAY () ), DAY )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.