Forum Discussion
Help with running cumulative count
- 5 years ago
Hi pablopablo ,
Try this.
Measure = VAR x = CALCULATE( COUNT(Sheet10[Job No]), FILTER( Sheet10, [Week Opened] <= MAX('Calendar'[Week]) && [Week Closed] > MAX('Calendar'[Week]) ) ) RETURN xBest regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pablopablo , Create a Week Table, You can do using generate series and analyze week data using that.
Try the formula like
Current Jobs = CALCULATE(COUNTx(FILTER(Table,Table[Week Opened]<=max('Week'[Week]) && (ISBLANK(Table[Week Opened]) || Table[Week Opened]>max('Week'[Week]))),(Table[Job No])))
Do no join week with any of the columns
Very similar to the approch in https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
Hi. thanks for your reply.
We already have a calendar table setup which has 'week' column in it
My roles table (where this data is already coming from, is already linked to this calendar table via date opened in the roles table and date in the calendar table. there is another join which joins on the date closed in the roles table and date field in the calendar table.
Would your example still work?
- amitchandak5 years agoSuper User
pablopablo , You have use crossfilter to remove any active join. refer to my blog for that https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
- pablopablo5 years agoFrequent Visitor
Hi,
I used your article and have the following code:
Weekly Cummulative = CALCULATE(COUNTx(FILTER('Live_Roles_Feed',Live_Roles_Feed[Date opened]<=max('Calendar_New'[Date]) && (ISBLANK('Live_Roles_Feed'[Date job closed]) || 'Live_Roles_Feed'[Date job closed]>max('Calendar_New'[Date]))),('Live_Roles_Feed'[Job no.] )),CROSSFILTER(Live_Roles_Feed[Date opened],'Calendar_New'[Date],None))However, it displays like this. I have even created a calendar table using your guide and linked accordingly