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! Request now

Reply
Anonymous
Not applicable

Date only update when refresh

Hi, 

 

I have the below equation which create a table for last 7 days.

 

However, I would like to know is there any method stop the powerBI calculating the latest "Today" when I open the file? 

 

In other words when I last updated the file on 13/9, the "today" should stay at 13/9 even when I open the file today(14/9), so that the last 7 days record can align with the data period received during that 7 days.

 

Thank you.

 

Equation:

Table =
VAR _today = TODAY()
 
RETURN
UNION
(ADDCOLUMNS(CALENDAR(_TODAY - 7,_TODAY) , "FILTER", "Last 7 Days","Order",0))
2 ACCEPTED SOLUTIONS
ReneMoawad
Resolver III
Resolver III

Hi @Anonymous,

 

Please follow the below steps to create a new table we use it to get the Last Refreshed Date

- Open Transform Data

- Click on New Source and choose Blank Query

- Click on Advanced Editor and insert the below script:

let
    Source = #table(type table[Date Last Refreshed = datetime], {{DateTime.LocalNow()}})
in
    Source

 

Those steps will create a table with 1 value which is the Last Refreshed Date, change the type of this column to Date

now in your measure, change the below formula

VAR _today = TODAY()

To

VAR _today = MAX('LastRefreshedTable'[Date])

 

This field will only refresh when you Refresh the table "LastRefreshedTable"

View solution in original post

4 REPLIES 4
ReneMoawad
Resolver III
Resolver III

Hi @Anonymous,

 

Please follow the below steps to create a new table we use it to get the Last Refreshed Date

- Open Transform Data

- Click on New Source and choose Blank Query

- Click on Advanced Editor and insert the below script:

let
    Source = #table(type table[Date Last Refreshed = datetime], {{DateTime.LocalNow()}})
in
    Source

 

Those steps will create a table with 1 value which is the Last Refreshed Date, change the type of this column to Date

now in your measure, change the below formula

VAR _today = TODAY()

To

VAR _today = MAX('LastRefreshedTable'[Date])

 

This field will only refresh when you Refresh the table "LastRefreshedTable"

Anonymous
Not applicable

Hi @ReneMoawad 

 

I am new to this method and when I type in the equation you provided, the table is not creating, may you please share how you do it?

Jason123_0-1663207679288.png

 

Screenshot 2022-09-15 090311.png

 

 

Screenshot 2022-09-15 090337.png

Anonymous
Not applicable

Thanks! The equation is working, I will further have a test tomorrow to see whether the date will only update on refresh.

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.