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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sumneshnepalia
Frequent Visitor

filter data on report refresh time

We have data in following format from Direct query and I need to filter a graph on last refresh time 

 

i.e. timestampvalue from "TIMESTAMP" column equal to timestampvalue from "Current time"
tried below logic but it doesnt work

Latest_timestamp_flag =
IF(LOOKUPVALUE(A[TIMESTAMP],A[TIMESTAMP],HOUR(A[TIMESTAMP]) & ":" & MINUTE(A[TIMESTAMP])) = HOUR(now()) & ":" & MINUTE(now()), 1, 0)



so if the current time is 8:04 AM then it should show only highlighted rows



sumneshnepalia_1-1729523954640.png


Requirement is to show following table

sumneshnepalia_0-1729590614960.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sumneshnepalia ,

 

This logic you're talking about holds true in the row context when creating calculated columns:

vlinhuizhmsft_0-1729837438961.png

And I created a measure, at this point the filter context works, you can also use SELECTEDVALUE instead of MAX:

vlinhuizhmsft_1-1729837471829.png

You can test the formula I've given and let me know if you have any problems, or clarify in your next reply if I've misunderstood what you've said.

 

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Thanks for the reply from lbendlin.

 

Hi @sumneshnepalia ,

 

please try the following DAX:

 

Measure=IF(HOUR(MAX('A'[TIMESTAMP]))&MINUTE(MAX('A'[TIMESTAMP]))=HOUR(NOW())&MINUTE(NOW()),1,0)

 

The visual is then filtered using measure:

vlinhuizhmsft_0-1729757751589.png

 

Result:

vlinhuizhmsft_1-1729757956707.png

 

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

@Anonymous  I think this logic will compare max timestamp for the date but I need the flag for current time stamp = time stamp of the date

Anonymous
Not applicable

Hi @sumneshnepalia ,

 

This logic you're talking about holds true in the row context when creating calculated columns:

vlinhuizhmsft_0-1729837438961.png

And I created a measure, at this point the filter context works, you can also use SELECTEDVALUE instead of MAX:

vlinhuizhmsft_1-1729837471829.png

You can test the formula I've given and let me know if you have any problems, or clarify in your next reply if I've misunderstood what you've said.

 

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

lbendlin
Super User
Super User

what if you use a table visual and group by timestamp?

lbendlin
Super User
Super User

what if you use a table visual and group by timestamp?

@lbendlin how can I filter it for current timestamp as I have rows for eevery minute 

Try it out. Power BI will automatically group for you.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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