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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Giada90
Helper III
Helper III

formula from dax to m

Hi,

I need to create a formula like this from dax to m

dafx formula:

column1=  DATEDIFF(foglio1[field1], TODAY(), MONTH)

thanks

 
1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

this is how the calculated column would work for datediff in months between 2 fields:

 

Number.Round(Number.From(([Column2] -[Column1])/( 365.25 / 12 )) ,0 )

 

I would create a custom column for todays date and use that as one of the fields before this column.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

3 REPLIES 3
DOLEARY85
Resident Rockstar
Resident Rockstar

Just to follow up you can replace the today column in the datediff calc with:   Date.From( DateTime.LocalNow()) 

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

thanks!

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

this is how the calculated column would work for datediff in months between 2 fields:

 

Number.Round(Number.From(([Column2] -[Column1])/( 365.25 / 12 )) ,0 )

 

I would create a custom column for todays date and use that as one of the fields before this column.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.