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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.