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

DATEDIFF

Hi everybody,

 

I have a dataset where I want to compute the ageing of some items to date.

 

Basically what I want to do is very easy, it's a subtraction of the item date and TODAY() function. 

 

I tried to do it creating a measure using DATEDIFF, however when I use this function I cannot select the column field containing the item dates after the parenthesis.

 

Why I cannot use it as a measure? Should I then go to the query editor? If yes, what's the formula to use instead of DATEDIFF?

 

Thanks in advance.

 

Andrea

 

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

Have you tried using the DATEDIFF function in a calculated column, rather than in a calculated measure?

 

Do you hve a small sample set of data?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

Have you tried using the DATEDIFF function in a calculated column, rather than in a calculated measure?

 

Do you hve a small sample set of data?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

Hi @Phil_Seamark,

 

it worked perfectly. Could you please tell me what's the difference between a measure and a calculated column?

 

Thanks in advance.

 

Cheers,

Andrea

Hi @Anonymous

 

Sure.  Here is one of the better summaries I have seen recently

 

https://community.powerbi.com/t5/Desktop/column-vs-measure/m-p/13201/highlight/true#M3304

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

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.