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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
cheskafausto
Frequent Visitor

Showing graph based on current time

Hi everyone,

 

I am just starting with power bi desktop and service and I am not sure if this question has been asked already, so please bare with me. 

 

I have a set of forecasted data for a current day coming in through an Oracle database through direct query and the client application that alters the database, refreshes that data every hour.

 

Is it possible to make a calculation (measure or column) , so that , in the power bi service dashboard, it would only show a graph available at that current time?

 

For example, I have forecast data for the current day and it is 1pm at the moment. So in the dashboard, it should show only data from 12mn til 1pm. Once the clock strikes 2pm and the data refreshes on the dashboard, it should now show a graph 12mn til 2pm. 

1 ACCEPTED SOLUTION

Hello again, 

 

Fortunately, I got it to work the other day by adjusting the code. I filtered the datetime column to only show the current day and came up with this code below: 

 

#"custom step"=Table.SelectRows(#"Name of Previous Step", each ([Datetime]) <=(DateTime.LocalNow()))

 

Thank you for helping me out on this one! 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @cheskafausto,

 

You can try to add current time filter in query editor.

 

Sample:

 

#"custom step"=Table.SelectRows(#"Name of Previous Step", each Time.From([Datetime]) >=Time.From("0:00:00") and Time.From([Datetime])<=Time.From(DateTime.LocalNow()))

 

 

Reference link:

Power Query Current Date Filter

 

Regards,

Xiaoxin Sheng

Hi v-shex-msft 

 

The code you provided worked perfectly, however, i had to change the querying mode to import. It does not allow this through direct query. I need this to work on direct query. Any ideas? 

Anonymous
Not applicable

Hi @cheskafausto,

 

Based on test, current power bi query editor not support use dynamic filter parameter in 'direct query' mode.

 

Regards,

Xiaoxin Sheng

Hello again, 

 

Fortunately, I got it to work the other day by adjusting the code. I filtered the datetime column to only show the current day and came up with this code below: 

 

#"custom step"=Table.SelectRows(#"Name of Previous Step", each ([Datetime]) <=(DateTime.LocalNow()))

 

Thank you for helping me out on this one! 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors