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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
ThomasBP
Frequent Visitor

calculate date between install date and todays date

Hi everyone,

This is my first post.
First, thanks to all the community. You are so great ! Thanks to you I improved my PBI skills very fast haha.
Before posting this, I tried to find my answer but I couldn't so ... I hope I did not missed the tip ...

Like the title is saying, I would like to calculate the delta between two dates.
My tab1 came from a SQL request but I'm trying to use as much as possible all opportunities given by PBI so i'm focusing on this.

In one hand I have :  [Date_of_visit] and in the other hand [Date_of_Today]. And I would like a column or something to put in my dashboard like [Day_passedby_since_last_visit]
Indeed:


1/ In first I created a new measure to find the lastest date of visit for each people :
Last visit = CALCULATE(MAX('Table1'[Date_of_visit]); ALL('Table1'[Date_of_visit]))

2/ In the other I created a new column in my data giving me the date of today :
DateTime.LocalNow()

 

The fact is one tab is a measure and the other a created column.
When I try to create a new column for the calcul of the  I can't find the mesure of my last date in the droplist.
When I try to create a new measure I can't find my new column in the options given.

So, could someone give me a trick for this ? 
I know it is pretty simple ... but I don't find any solution for that.

Regards, 
Thomas


2 ACCEPTED SOLUTIONS
v-juanli-msft
Community Support
Community Support

Hi @ThomasBP

If you want to display the [Day_passedby_since_last_visit] in Table2, 

You could try measures in either Table1 or Table2 as below

last_visit2 = CALCULATE(MAX(table1[date_of_visit]),ALLEXCEPT(table2,table2[person_id]))

Current_time = TODAY()

Day_passedby_since_last_visit = DATEDIFF([last_visit2],[Current_time],DAY)

7.png

 

If you want to display the [Day_passedby_since_last_visit] in Table1, 

You could try measures in either Table1 or Table2 as below

last_visit3 = CALCULATE(MAX(table1[date_of_visit]),ALLEXCEPT(table1,table1[person_id]))

Current_time = TODAY()

Day_passedby_since_last_visit2 = DATEDIFF([last_visit3],[Current_time],DAY)
8.png
 
Best Regards
maggie
 

 

View solution in original post

Hello !  

Thanks for the answer ! 
It is workin' fine ! 

I had read that to get the date of today we had to create a new column with the formula "DateTime.LocalNow()"
For now I am using " Today () ". Hope that tomorrow It won't be stuck to 29/11/2018 but will be refresh as  30/11/2018.
What is the difference between both  ?

Have a nice day 🙂
Best regards, 
Thomas

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @ThomasBP

If you want to display the [Day_passedby_since_last_visit] in Table2, 

You could try measures in either Table1 or Table2 as below

last_visit2 = CALCULATE(MAX(table1[date_of_visit]),ALLEXCEPT(table2,table2[person_id]))

Current_time = TODAY()

Day_passedby_since_last_visit = DATEDIFF([last_visit2],[Current_time],DAY)

7.png

 

If you want to display the [Day_passedby_since_last_visit] in Table1, 

You could try measures in either Table1 or Table2 as below

last_visit3 = CALCULATE(MAX(table1[date_of_visit]),ALLEXCEPT(table1,table1[person_id]))

Current_time = TODAY()

Day_passedby_since_last_visit2 = DATEDIFF([last_visit3],[Current_time],DAY)
8.png
 
Best Regards
maggie
 

 

Hello !  

Thanks for the answer ! 
It is workin' fine ! 

I had read that to get the date of today we had to create a new column with the formula "DateTime.LocalNow()"
For now I am using " Today () ". Hope that tomorrow It won't be stuck to 29/11/2018 but will be refresh as  30/11/2018.
What is the difference between both  ?

Have a nice day 🙂
Best regards, 
Thomas

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors