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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculating the number of days between a date and todays date

I have no idea how microsoft manage to make such a simple thing so complicated? 

 

I have an excel file connected to PowerBI and a text columnn has been "transformed" to date value, all looks OK etc. The colum is called [StatDueOn].

 

Now the magic? Just trying to calculate Now()-[StatDueOn] OR whatever the formula is.....takes 2 secs to do this in Excel/Access, but keep getting errors.  What is the correct syntax. I have added a custome column when I do this.....called DaysLate

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

It is in the Modeling pane in "BI/Graphic phase"


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

hi @Anonymous 

try new calculated column 

Column = DATEDIFF([StatDueOn], NOW(), day)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

HI is this in the query edit phase, or on the BI/Graphics phase? Have realised (reswitched brain on!) that new measures can be added post transformation, whereas I was trying to do all calcs during the backend phase.....


@az38 wrote:

hi @Anonymous 

try new calculated column 

Column = DATEDIFF([StatDueOn], NOW(), day)

 

az38
Community Champion
Community Champion

Hi @Anonymous 

It is in the Modeling pane in "BI/Graphic phase"


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Worked ok then - before it was not finding [StatDueOn] - note I added NEW Column and not new measure etc and it was fine.


@az38 wrote:

Hi @Anonymous 

It is in the Modeling pane in "BI/Graphic phase"


 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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