The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I used this dax filter
= VAR _today = TODAY ()
RETURN
UNION
ADDCOLUMNS (
CALENDAR (_today - 30,_today )
, "Filter",
"30 Days"
, ADDCOLUMNS (
CALENDAR (_today - 90, _today )
"Filter",
"90 Days"
), ADDCOLUMNS (
CALENDAR (_today - 365, _today )
, "Filter", "Last Year" ))
to create a filter on my dashboard for 30 days, 90 days and a year. It works fine in the desktop version but when I published it to the workspace it stopped working. How do I fix this?
Solved! Go to Solution.
Hi @Wreniscat ,
Thanks for using Microsoft Fabric Community and sharing the issue. What you're experiencing is a known behavior difference between Power BI Desktop and Power BI Service, particularly when using functions like TODAY() or NOW() inside calculated tables.
In Power BI Desktop, functions like TODAY() return the current date based on your local system clock. However, once you publish to Power BI Service, the report is hosted on Microsoft’s cloud servers (typically in UTC time), and these functions evaluate based on the server's time at dataset refresh, not at report query time.
So if you're using TODAY() inside a calculated table, it won’t recalculate dynamically when a user interacts with the report online. It only updates when the dataset is refreshed.
Similar discussions:
Solved: Measure working on Desktop but not on Power BI onl... - Microsoft Fabric Community
Please try this to resolve it:
Create a static table with values like "Last 30 Days", "Last 90 Days", "Last Year" using DATATABLE() or Power Query.
Use that table in a slicer.
Modify your measure to interpret the selected value and calculate the appropriate date range dynamically using TODAY() inside the measure, not in the calculated table.
Example:
Date Range =
DATATABLE(
"Range", STRING,
{
{"Last 30 Days"},
{"Last 90 Days"},
{"Last Year"}
}
)
Filtered Amount =
VAR _today = TODAY()
VAR _range = SELECTEDVALUE('Date Range'[Range])
VAR _startDate =
SWITCH(
TRUE(),
_range = "Last 30 Days", _today - 30,
_range = "Last 90 Days", _today - 90,
_range = "Last Year", _today - 365,
BLANK()
)
RETURN
CALCULATE(
SUM('TestSales'[Amount]),
'TestSales'[Date] >= _startDate && 'TestSales'[Date] <= _today
)
Result:
Desktop:
Service:
This ensures consistent behavior across Power BI Desktop and Service.
If you're seeing a time mismatch (e.g., the report appears to be 1 day behind), it's because Power BI Service evaluates date/time in UTC, not your local time. To fix this, adjust the offset in your DAX:
LocalToday = TODAY() + (OffsetHours / 24)
For example, for Pacific Time (UTC–7):
LocalToday = TODAY() - (7 / 24)
Please refer this for more details:
Solving DAX Time Zone Issue in Power BI - RADACAD
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.
Thank you.
Hi @Wreniscat ,
We’re following up once more regarding your query. If it has been resolved, please mark the helpful reply as the Accepted Solution to assist others facing similar challenges.
If you still need assistance, please let us know.
Thank you.
Hi @Wreniscat ,
Following up to see if your query has been resolved. If any of the responses helped, please consider marking the relevant reply as the 'Accepted Solution' to assist others with similar questions.
If you're still facing issues, feel free to reach out.
Thank you.
Hi @Wreniscat ,
Just checking in to see if you query is resolved and if any responses were helpful. If so, kindly consider marking the helpful reply as 'Accepted Solution' to help others with similar queries.
Otherwise, feel free to reach out for further assistance.
Thank you.
Hi @Wreniscat ,
Thanks for using Microsoft Fabric Community and sharing the issue. What you're experiencing is a known behavior difference between Power BI Desktop and Power BI Service, particularly when using functions like TODAY() or NOW() inside calculated tables.
In Power BI Desktop, functions like TODAY() return the current date based on your local system clock. However, once you publish to Power BI Service, the report is hosted on Microsoft’s cloud servers (typically in UTC time), and these functions evaluate based on the server's time at dataset refresh, not at report query time.
So if you're using TODAY() inside a calculated table, it won’t recalculate dynamically when a user interacts with the report online. It only updates when the dataset is refreshed.
Similar discussions:
Solved: Measure working on Desktop but not on Power BI onl... - Microsoft Fabric Community
Please try this to resolve it:
Create a static table with values like "Last 30 Days", "Last 90 Days", "Last Year" using DATATABLE() or Power Query.
Use that table in a slicer.
Modify your measure to interpret the selected value and calculate the appropriate date range dynamically using TODAY() inside the measure, not in the calculated table.
Example:
Date Range =
DATATABLE(
"Range", STRING,
{
{"Last 30 Days"},
{"Last 90 Days"},
{"Last Year"}
}
)
Filtered Amount =
VAR _today = TODAY()
VAR _range = SELECTEDVALUE('Date Range'[Range])
VAR _startDate =
SWITCH(
TRUE(),
_range = "Last 30 Days", _today - 30,
_range = "Last 90 Days", _today - 90,
_range = "Last Year", _today - 365,
BLANK()
)
RETURN
CALCULATE(
SUM('TestSales'[Amount]),
'TestSales'[Date] >= _startDate && 'TestSales'[Date] <= _today
)
Result:
Desktop:
Service:
This ensures consistent behavior across Power BI Desktop and Service.
If you're seeing a time mismatch (e.g., the report appears to be 1 day behind), it's because Power BI Service evaluates date/time in UTC, not your local time. To fix this, adjust the offset in your DAX:
LocalToday = TODAY() + (OffsetHours / 24)
For example, for Pacific Time (UTC–7):
LocalToday = TODAY() - (7 / 24)
Please refer this for more details:
Solving DAX Time Zone Issue in Power BI - RADACAD
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.
Thank you.