cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
great_AS Member
Member

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

Accepted Solutions
Highlighted
Phil_Seamark Super Contributor
Super Contributor

Re: DATEDIFF

Hi @great_AS

 

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
Highlighted
Phil_Seamark Super Contributor
Super Contributor

Re: DATEDIFF

Hi @great_AS

 

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

great_AS Member
Member

Re: DATEDIFF

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

Phil_Seamark Super Contributor
Super Contributor

Re: DATEDIFF

Hi @great_AS

 

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
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 258 members 2,774 guests
Please welcome our newest community members: