Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SteveM
Regular Visitor

Gatwway Data Refresh

Hoping if some can tell me if this is the expected behaviour. 

The queries setup use the "Today" filter on the date column.

This seems to be the only way to automatically retrieve the data for TODAY, this does not seem possible when done in the report/dash itself.

 

This "Seems" to be the issue with the data not refreshing correctly

Each morning I have to open the reports in Desktop, refresh and publish. from then on the data is nicely updated via the direct query/gateway throughout the day.

 

When tomorrow comes, the data set does not update and the reports are stuck on the previous days data until I refresh and re-publish again.

 

Assuming this is the expected behaviour then how do we set the filter in the reports to only show date from "Today" without having to refilter the data manually, I cant see how.

I would have thought having the filtering done at the query level would have been the more efficient way to do this ? 

1 ACCEPTED SOLUTION

@SteveM

 

You can consider adding a calculated column for tagging "Today" or not.

 

TodayOrNot = IF(Table[Date]=TODAY(),"Today","Not Today")

Then you can create a slicer with this column. Please refer to thread: 

http://community.powerbi.com/t5/Desktop/Direct-Query-Today-Date-function/m-p/57208#M23337

 

Regards,

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Not sure I would call that expected behavior but I do not entirely understand how your queries are setup. One of the tricks for displaying "today" in the reports is to have a calculated column in either the query or DAX that essentially a 1 if it is today and a 0 if it is not today. In Power Query you use something like:

 

if [Date] = DateTime.Date(DateTime.LocalNow()) then 1 else 0

The equivalent in DAX is:

IsTodayDAX = IF([Date] = TODAY(),1,0)

You then set your report filter to only display rows where this column is 1. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks, good tip to know but they dont look to be supported by direct query ?

@SteveM

 

You can consider adding a calculated column for tagging "Today" or not.

 

TodayOrNot = IF(Table[Date]=TODAY(),"Today","Not Today")

Then you can create a slicer with this column. Please refer to thread: 

http://community.powerbi.com/t5/Desktop/Direct-Query-Today-Date-function/m-p/57208#M23337

 

Regards,

Thank you 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors