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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mbailey
Helper II
Helper II

Can't create datediff measure

Hi,

 

I've got a table with a date field in it called install_date. The field is of Type Date:

mbailey_0-1632404958714.png

mbailey_1-1632404970051.png

I'm trying to create a measure to calc the number of days between this date and Today using this formula, but it errors saying it can't find the field.  When building the formula, it only wants to suggest fields that are existing Measures and I can't pick any other fields.

mbailey_2-1632405096648.png

 

What am I missing?

 

Thanks,

Mike

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mbailey , you can create a column like that.

For measure, you have to use min/max.

 

or

 

Try like

Averagex(Table, datediff([Install Date], today(), day) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@mbailey 
You cannot just refer to a column in a measure, you must add a function to refer to a column value. In your case, using min, max, sum, average, selectedvalue, are all the same they just call out the current row of the [install_date].

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Watsky
Solution Sage
Solution Sage

Hey @mbailey,

 

@amitchandak  is correct since you're doing a measure there needs to be some sort of aggregator.  Another option you can try is using SELECTEDVALUE

 

 InstallDays =  DATEDIFF(SELECTEDVALUE('DMTA_Service_Install_Base'[install_date]),TODAY(),DAY)

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up! ?
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

amitchandak
Super User
Super User

@mbailey , you can create a column like that.

For measure, you have to use min/max.

 

or

 

Try like

Averagex(Table, datediff([Install Date], today(), day) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors