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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
RichardS
New Member

Significant anniversaries

I am new to the Board so if this has been covered elsewhere, apologies.....

 

I am trying to get a report to show upcoming anniversaries of service, flagging specifically significant ones such as 10th, 21st, 25th etc.  I can get the upcoming anniversaries using a date column from Excel and calculating in a table using DAX the number of years passed.  I have added a table of the "key" years but I cannot think how to link that to the years calculated in the table.  My alternative was to calculate the number of years in the query but I cannot see an equivalent to the DAX "TODAY()" function.  Please can anyone help?

 

Thanks

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

the M funcitons that may help you are:

https://msdn.microsoft.com/en-us/query-bi/m/datetime-localnow

https://msdn.microsoft.com/en-us/query-bi/m/datetime-fixedlocalnow

they return DateTime type so you may want to convert it to Date type
https://msdn.microsoft.com/en-us/query-bi/m/datetime-date

 

I'm not clear on how you want to merge the tables - is it with simple join?

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Perhaps something like this:

 

Column = IF([Years]) IN 'KeyYears'[Years],"Important","Still important but not really all that important")

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Stachu
Community Champion
Community Champion

the M funcitons that may help you are:

https://msdn.microsoft.com/en-us/query-bi/m/datetime-localnow

https://msdn.microsoft.com/en-us/query-bi/m/datetime-fixedlocalnow

they return DateTime type so you may want to convert it to Date type
https://msdn.microsoft.com/en-us/query-bi/m/datetime-date

 

I'm not clear on how you want to merge the tables - is it with simple join?

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Got it, thanks

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.