Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have the following code which correctly gives me a running total based on a week number of total jobs opened per week. However, i need to amend so it does not count those jobs which have already closed before or during the current week.
I also need to filter out only those records where a status does not equal "Cancelled"
So if my data looks like this
Job No | Week Opened | Week Closed |
001 | 1 | 4 |
002 | 2 | 7 |
003 | 2 | 5 |
004 | 4 | 9 |
005 | 5 | 6 |
I expect my measure to return "Total Records per week"
Week 1 - 1
Week 2 - 3
Week 3 - 3
Week 4 - 3 (as the first record closed in week 4)
Week 5 - 4 (as the third record closed in week 5)
Week 5 - 4
Week 6 - 2
Measure =
CALCULATE (
COUNT ( 'Live_Roles_Feed'[Job no.] ),
FILTER (
ALLSELECTED ( 'Live_Roles_Feed' ),
'Live_Roles_Feed'[Week_Opened] <= MAX ( 'Calendar'[Week] )
)
)
Solved! Go to Solution.
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
x
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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
x
Best regards,
Lionel Chen
If 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-tr...
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?
@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-tr...
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
78 | |
63 | |
52 | |
47 |
User | Count |
---|---|
212 | |
82 | |
61 | |
61 | |
60 |