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 there,
I have a report where I want to have a dynamic distinct count of users who have booked time to a project within the last month of a certain date. This is the information that I want to show with the Department Size being the dynamic count and the Capacity worked out from that:
The report has a filter on the reporting date (a Week Commencing date which is in a date table). The relationship is shown here:
What I want to show is basically the average distinct count of the Employee ID over the previous 4 weeks.
The problem I have is that the slicer causes the result of my measure to be fixed over time whereas I want to see over time the change in this average based on the previous 4 weeks of wherever it lies on the timeline.
As you can see here the Capacity (which uses the Calculated Department Size measure) remains constant over time (as I think it will always pick up the reporting date selected in the slicer). What I want is e.g. 5th December should work out the average over its previous 4 weeks (14th Nov-5th Dec), not the 4 weeks up to the reporting date. This chart isn't connected to the Reporting Date slicer but defaults to last 2 months.
This is where I am with the DAX measure:
Calculated Department Size =
CALCULATE (
DISTINCTCOUNT ( Timesheet[Employee ID] ),
ALL ( 'Reporting Date'[Week Commencing] ),
Timesheet[Booked Hours] > 0,
'Reporting Date'[Week Commencing]
> MAX ( 'Reporting Date'[Week Commencing] ) - 28,
'Reporting Date'[Week Commencing] < MAX ( 'Reporting Date'[Week Commencing] )
)
I don't know whether one measure can do the job or if I need to set up one to cover the reporting date and one to cover the trend over time.
Thanks,
Marc
Hi @marcritchie ,
Please have a try.
Change all to allselected.
Calculated Department Size =
CALCULATE (
DISTINCTCOUNT ( Timesheet[Employee ID] ),
ALLSELECTED ( 'Reporting Date'[Week Commencing] ),
Timesheet[Booked Hours] > 0,
'Reporting Date'[Week Commencing]
> MAX ( 'Reporting Date'[Week Commencing] ) - 28,
'Reporting Date'[Week Commencing] < MAX ( 'Reporting Date'[Week Commencing] )
)
If I have misunderstood your meaning, please provide your pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@marcritchie , In case you can have week rank in date or week yeat tbale
a new column
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
CALCULATE(AverageX(values('Date'[Year Week]) ,calculate(DISTINCTCOUNT ( Timesheet[Employee ID] ))), FILTER(ALL('Date'),'Date'[Week Rank]>=max('Date'[Week Rank])-8 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
Rolling 4 = CALCULATE(AverageX(values('Date'[Year Week]) ,calculate(DISTINCTCOUNT ( Timesheet[Employee ID] ))),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-28,DAY))
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 |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
26 | |
24 | |
12 | |
11 | |
10 |