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
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
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