Forum Discussion
Benji_B
5 years agoFrequent Visitor
Queue Population Reset
Hi all, I am attempting to use measures to calculate the number of people in a queue at any given point at time. I have 'In' set as the number of people entering the process (let's say it's a sho...
- 5 years ago
Hi Benji_B ,
First convert measure RollingSumofCountIn; RollingSumofCountOut; QueuePopulation into columns;
Then create 2 columns as below:
flag = var _prevalue=CALCULATE(MIN('example'[Column_Q]),FILTER('example','example'[Time]<=EARLIER(example[Time])&&'example'[Column_Q]<0)) var _time=CALCULATE(min('example'[Time]),FILTER('example','example'[Column_Q]=_prevalue)) Return IF('example'[Time]=_time&&'example'[Column_Q]<0,1,0)col_Adjust = var _time=CALCULATE(MAX('example'[Time]),FILTER('example','example'[Time]<=EARLIER(example[Time])&&'example'[flag]=1)) var _q=CALCULATE(MAX('example'[Column_Q]),FILTER('example','example'[Time]=_time)) Return IF('example'[Time]<_time,'example'[Column_Q], IF('example'[Time]=_time,0, 'example'[Column_Q]-_q))And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution
AlB
5 years agoCommunity Champion
Hi Benji_B
The uploaded file doesn't seem to have any information on time, nor does it include the code you've already put together.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers