FoxyB
FoxyB

Reputation: 61

Calculate the number of days between today and specific date using DAX in Powerpivot

I have a date column in my data model. I want to calculate the # of days between today and the date in the column using DAX.

Thoughts?

Upvotes: 3

Views: 19179

Answers (2)

EssentialMarie
EssentialMarie

Reputation: 47

The accepted answer didn't work for me; there was an error message that today() wasn't recognized—even though it works well in measures.

The following function worked in the calculated column:

= Date.From(DateTime.LocalNow()) - [my col with date]

Upvotes: 0

nicolò grando
nicolò grando

Reputation: 407

You can create a calculated column with this formula:

=today()-[DATE]

and change the value of column in numeric:

enter image description here

Upvotes: 3

Related Questions