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
TheLoonies
Frequent Visitor

Counting Active Processes

I want to create a calculated table or measure or visual which takes in a date and returns the count of the amount of processes which were in progress on that date.

 

For example:

 

Processstart timeend time time periodCount active
A15 12
B24 24
C69 33
D12 44
E47 55
F29 64
G55 74
H57 82
    92

 

I want to turn the data on the left into the data on the right.

This would be easy enought to do in power query, however I need the table on the right to change when a user filters the table on the left. 

Any Ideas on how to get this done? It might be possible to create a custom visual to do it, but I'm checking whether there is a better way before I dive into that.

1 ACCEPTED SOLUTION
TheLoonies
Frequent Visitor

I managed to get this to work how I wanted it to.

 

the table on the left is named ExampleData.

 

First I created a table of times from the data:

 

TimeTable = GENERATESERIES(MIN('ExampleData'[start time]),MAX('ExampleData'[end time]))
 
Then I used the following measure :
 
ActiveProcesses =
var MaxTime = MAX('TimeTable'[Value])
var MinTime = MIN('TimeTable'[Value])
RETURN
CALCULATE(COUNT('ExampleData'[Process])+0,
MaxTime >= 'ExampleData'[start time],
MinTime <= 'ExampleData'[end time])
 
Then I am able to plot 'Timetable'[value] against ActiveProcesses for the desired effect.

View solution in original post

6 REPLIES 6
TheLoonies
Frequent Visitor

I managed to get this to work how I wanted it to.

 

the table on the left is named ExampleData.

 

First I created a table of times from the data:

 

TimeTable = GENERATESERIES(MIN('ExampleData'[start time]),MAX('ExampleData'[end time]))
 
Then I used the following measure :
 
ActiveProcesses =
var MaxTime = MAX('TimeTable'[Value])
var MinTime = MIN('TimeTable'[Value])
RETURN
CALCULATE(COUNT('ExampleData'[Process])+0,
MaxTime >= 'ExampleData'[start time],
MinTime <= 'ExampleData'[end time])
 
Then I am able to plot 'Timetable'[value] against ActiveProcesses for the desired effect.
Ahmedx
Super User
Super User

or need creat new tablr like this

Sample PBIX file attached

https://1drv.ms/u/s!AiUZ0Ws7G26RiSRyYZQRTai6JWa2?e=SKEWjz

 

 

Table 2 = SUMMARIZE(GENERATE('Table', GENERATESERIES([start time],[end time],1)),[Value], "count", CALCULATE(COUNT('Table'[Process])))

 

 

 

Screen Capture #1349.png 

The problem is that the table doesn't change when I apply filters:

 

TheLoonies_0-1688020347356.png

here with only process F selected I would want 0 for value = 1 and 1 for value > 1

 

It works, but it's not exactly what I was hoping for; the approach lacks flexibility.

It feels like a workaround to make what I'm trying to do work with equalities, but the workaround requires multiplying the sizes of tables. I would be going from 10,000s of rows to millions.

 

Ahmedx
Super User
Super User

pls see my video

https://1drv.ms/v/s!AiUZ0Ws7G26RiSNORKRMHvAwGVLO?e=ooRecY

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

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.

Top Solution Authors