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
canterlm
Regular Visitor

Review Times

Hello, 

 

I need to calculate the difference between 2 date columns to determine how long a review took for each project. I need to do this for each row in the table not the columns as a whole. Does anyone know if and/or how this can be done? 

 

 

1 ACCEPTED SOLUTION

Hi @canterlm 

If you select "create measure", then use the formula below:

Day= DATEDIFF(MAX('Dates'[Complete Final App Received]) , MAX('Dates'[Final App Approved]), Day)

If you select "create calculated column", use the formula you provided.

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

4 REPLIES 4
amitchandak
Super User
Super User

@canterlm , please check the pbix. There are a few ways date diff has been taken within the table across tables.

 

Tad17
Solution Sage
Solution Sage

Hey @canterlm 

 

Assuming you just need days and not time this is possible, thought depending on what your data looks like it can get complicated.

 

First suggestion is to see if you can use DATEIFF like in this thread: https://community.powerbi.com/t5/Desktop/Calculate-difference-between-two-date-time-values/td-p/7184...

 

If that does not work then you can try adding an Age column in the query like in this thread: https://community.powerbi.com/t5/Desktop/Difference-between-two-dates-DAX/td-p/157320

 

The simplest solution that often doesn't work is to subtract the two and multiple by 1. to give you a numerical value for the date as in this thread: https://community.powerbi.com/t5/Desktop/calculate-number-of-days-between-2-dates/td-p/51213

 

Let me know if none of these work for you.

 

If this helps please kudo.

If this solves your problem please accept it as a solution.

@Tad17 

My formula is this-

 

Day= DATEDIFF('Dates'[Complete Final App Received] , 'Dates'[Final App Approved], Day)

 

I keep get this error-

"A single value for column 'Complete Final App Received' in table 'Dates' cannot be determined. This can happen when a measure formula refers to a comlun that contains many values without specifying an aggregation such as min, max, count or sum to get a single result."

 

I just need to know how many days passed between the dates in each of these columns in my table. 

 
 

Hi @canterlm 

If you select "create measure", then use the formula below:

Day= DATEDIFF(MAX('Dates'[Complete Final App Received]) , MAX('Dates'[Final App Approved]), Day)

If you select "create calculated column", use the formula you provided.

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.