Home > OS >  Define today's date in Power BI Desktop
Define today's date in Power BI Desktop

Time:10-12

Is there a way for me to manually change what Power BI takes as today's date?

E.g., I have dozens of measures and columns that use the "today()" variable, but now I need to know what the dashboard numbers were at a specific day in the past. Is there a way to change what Power BI considers "today" without having to edit all the formulas in the measures and columns?

Extra difficulty: I cannot simply change the system date/time because it is being sync'd with my organization.

CodePudding user response:

If you have Today() coded into your measures and formulas, then there's not much you can do to change that to a different date in retrospect.

Planning forward, however, you can take a different approach. Create a measure, let's call it calcToday and assign it the formula =Today().

Now construct all your downstream formulas, measures and calculations to use the measure [calcToday]. If you ever need to test the scenario for a different date, you only need to change the value of the calcToday measure.

CodePudding user response:

Below query is used to get last refreshed time of dashboard.

= #table(type table[Date Last Refreshed=datetime], {{DateTime.LocalNow()}})
  • Related