Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
This issue has appeared previously ... and the suggested solution was to amend the SQL Statement ... which is what I had to do to get a worakaround for the problem.
I don't believe that this should be necessary, and I think there is a problem with how the the Native Query is being rendered when you apply a Filter in the Query Editor.
If you apply a Filter of Time.LocalNow() then the date at the time the Query is being generated is what gets passed to the Server. This works fine on the day that you write it. But once you publish to the Power BI Service and issue a Refresh on a Mobile the following day, they the query is still looking for the Data as of the day on which you generated the Query. The date needs to be dynamic ... and the code passed ... [DATE] = GETDATE() or equivalent. (I'm not a SQL person).
Here is the Power Query source code ...
let
Source = Sql.Database("sqlserver", "DemoDB"),
dbo_View_Budget_Visitors = Source{[Schema="dbo",Item="View_Bookings"]}[Data],
#"Filtered Rows" = Table.SelectRows(dbo_View_Budget_Visitors, each [DATE] = DateTime.Date(DateTime.LocalNow() ) )
in
#"Filtered Rows"
This is how the Native Query is rendered ...
select [_].[DATE],
[_].[resourceName],
[_].[ADULT],
[_].[CHILD],
[_].[TOTAL]
from [dbo].[View_Bookings] as [_]
where [_].[DATE] = convert(datetime2, '2019-06-11 00:00:00') and [_].[DATE] is not null
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.