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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ArchStanton
Impactful Individual
Impactful Individual

Calculate Age of Items using fixed historic and future dates

Hi,

I've attached a link to my pbix file with some dummy data. Is there a way I can add just the pbix file?

 

https://www.dropbox.com/scl/fi/z2c9pykget7z4gutuhvsw/Age-Analysis.pbix?rlkey=wvj8rimvy6r00bccszpp9pl...

 

My aim is to create a calculated column that how many items are going to be =>18mths as at 1st Apr 2024

 

I have already calculated this using todays date here:

Age in Mths = DATEDIFF(
                   Data[Created On], 
                   NOW(),MONTH)

 

I have tried using DATEDIFF with "01/04/2024" but I was getting error messages about Text frmat and i should use FORMAT or VALUES.

 

This formaula does work but it returns 4 months for every row? My plan was to add this onto the Age in Mths column.

 

Once all this is done I would like to create a second column, replicating everything in the original column but factoring NETWORKDAYS & Bank Holidays into a second Age in Days2 and Age in Months2 column.

 

Can any show me where I'm going wrong?

Thanks

 

2 REPLIES 2
christinepayton
Super User
Super User

You need to format the date you're comparing to in a very specific way, see the example here:

https://dax.guide/datediff/

 

The double quotes is interpreted as text, so it can't use it the way you've entered it. 

Thank you, I'll give this a go

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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