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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

How to calculate a %age active from event data

Hi,

I have a number of machines and data showing a list of events (switch on and off), a small sample of which is shown here:

 

MachineDate/TimeEvent
0123/02/2023 10:48:00Activated
0123/02/2023 11:23:00Deactivated
0223/02/2023 11:52:00Activated
0323/02/2023 11:56:00Activated
0123/02/2023 12:04:00Activated
0423/02/2023 12:34:00Activated
0423/02/2023 12:38:00Deactivated
0523/02/2023 12:41:00Activated
0323/03/2023 12:43:00Deactivated

 

Is there any way to show graphically the number (or percentage) of machines "active" over time?

 

Many thanks

3 REPLIES 3
ToddChitt
Super User
Super User

Counting ACTIVE Measure = CALCULATE ( COUNTROWS ( 'Machine Events' ), 'Machine Events'[Event] = "Activated" )




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Anonymous
Not applicable

No, not easily, plus a machine may have a number of activate and deactivate events over the time period.

I had considered if it would be possible to have a running count of the number of activate events minus the number of deactivate events, but I'm not sure how to do that.

ToddChitt
Super User
Super User

You may need to get the data into a different shape. Any chance you can pair the Activate and Deactivate records for one machine on one row? Then you can calculate on that row how long the machine was active. Seems that would make it easier to get your final answer.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.