Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I need help how could I filter how many processes are running at a given time.
I have a table where there are 4 columns, Process name, Start Time, End Time and Country. I want to calculate how many processes are running at the same time for a a given time period. Most likely I'll filter by 1 hour periods, like 8:00-9:00 and 12:00-13:00.
I can't figure out how to write a calculated table/column or maybe a DAX measure that could show this.
Since I'm a newbie and don't usually work with PowerBI i need some help and guidance, what could be the best approach to this?
Do I need to create additional table with all given hours of the day? Table looks something like this, but it has more than 100 rows.
So the main goal is to have a visual with maybe 24hour period with time stamps that shows how many processes are running at the same time at that given time period.
Any help will be much appreciated. Thanks!
Solved! Go to Solution.
Hi @KalvisTe
You are on the right path with an Hour table.
After adding an hour, you can use a measure like this...
Active =
VAR _Hr = SELECTEDVALUE( 'Hours'[Hour] )
VAR _Logic =
CALCULATE(
COUNTROWS( 'Processes' ),
FILTER(
'Processes',
'Processes'[Start Time] <= _Hr
&& 'Processes'[End Time] >= _Hr
)
)
RETURN
_Logic
Hi @KalvisTe
You are on the right path with an Hour table.
After adding an hour, you can use a measure like this...
Active =
VAR _Hr = SELECTEDVALUE( 'Hours'[Hour] )
VAR _Logic =
CALCULATE(
COUNTROWS( 'Processes' ),
FILTER(
'Processes',
'Processes'[Start Time] <= _Hr
&& 'Processes'[End Time] >= _Hr
)
)
RETURN
_Logic
Loggged in with work account. I can't understand why I get nothing on my visuals. I think that I have done everything correctly, double checked with the file you provided. Any suggestions as what could be wrong?
My Hour table
My MainTable:
I'm not sure what you problem might be. Your setup looks correct.
Can you show me how you are trying to use it? ie. a table visual with Hour and [Active] measure like in my example OR are you trying to use it in a different scenario?
I tried it multiple ways. With a table, with a visual. Same result, nothing shown. It has got to with how the data was imported. I created a small table manually, with the columns and values. It works then. I'll work around this somehow.
Sorry. I wish I could help but there's not much I can do at this point.
Anyway, thanks for your help! Your measure worked great! I just figured out the reason for it not showing the values. So in my Data pane i changed the values to Time, but in query it was still shown as Date/Time, changed it there as well and it works now! 🙂
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |