Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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?  ...
  • ReneMoawad's avatar
    3 years ago

    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"

  • ReneMoawad's avatar
    ReneMoawad
    3 years ago