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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
v_mark
Helper V
Helper V

Show Last 24 Hours in a clustered column chart

I was trying to create a measurement that will show the total crimes in the last 24 hours on a chart. 
This Hour and Last Hour works fine. But the Last 24 is not.  Seems like it will no go through the entire Last 24 hours from Now() 


Not sure if I need to use another visual to show it or probably just have it on a table/matrix and drag the dates in just to show 
those affected dates/data

 

I have this calc column in my time table 

Last 24 Hours =
var _now = TIME(HOUR(NOW()), MINUTE(NOW()), SECOND(NOW()))
RETURN
if (DATEDIFF(_NOW, 'Time'[TimeandDay], HOUR) in GENERATESERIES(-23, 0, 1), 1, 0)
 

Any help would be greatly appreciated. 

 

 
Here is the Power BI File that I am working with.      Sample Data
2 REPLIES 2
jameszhang0805
Resolver IV
Resolver IV

I wonder if this is the reason, it seems like you made a minor mistake in your measure. If change this place to 
"Last 24 Hours", the chart worked

jameszhang0805_0-1613788022490.png

jameszhang0805_1-1613788167189.png

 

rfigtree
Resolver III
Resolver III

i might be completely off base but would this work.

 

=  var HrsDelta = 24 *( NOW() - Table1[dateTime] )
   return if( HrsDelta <= 24 && HrsDelta >= 0, TRUE(), FALSE())

 

rfigtree_0-1613785236749.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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