Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Rolling total based on start date of department

Hi Experts!

 

 I am very new to Power BI , and trying to calculate Rolling 12 month  total and average for the department headcounts based on  start date of department  in another table.

 

Headcount table is as below

Report DateDepartment Name Headcount 
31/05/2019Department Layer 211
30/06/2019Department Layer 21659
31/07/2019Department Layer 21646
31/08/2019Department Layer 21660
31/07/2018Department Layer 223
31/08/2018Department Layer 223
30/09/2018Department Layer 22164
31/10/2018Department Layer 22180
30/11/2018Department Layer 22183
31/12/2018Department Layer 22180
31/01/2019Department Layer 22185
28/02/2019Department Layer 22186
31/03/2019Department Layer 22185
30/04/2019Department Layer 22186
31/05/2019Department Layer 22189
31/07/2019Department Layer 22286
31/08/2019Department Layer 22289
31/07/2018Deprtment Layer 11205
31/08/2018Deprtment Layer 11308
30/09/2018Deprtment Layer 11289
31/10/2018Deprtment Layer 11163
30/11/2018Deprtment Layer 11288
31/12/2018Deprtment Layer 11274
31/01/2019Deprtment Layer 11277
28/02/2019Deprtment Layer 11300
31/03/2019Deprtment Layer 11315
30/04/2019Deprtment Layer 11338
31/05/2019Deprtment Layer 11321
30/06/2019Deprtment Layer 11170
31/07/2019Deprtment Layer 11288
31/08/2019Deprtment Layer 11312

 

The dates when the department starts is in below table

 

Department NameDepartment StartDate
Deprtment Layer 131/07/2017
Department Layer 2231/03/2019
Deprtment Layer 2130/06/2019

 

The measure i want to create is as below

 

Report DateDepartment Name Measure
-Deprtment Layer 1Rolling 12 months data from the latest report date backwards
-Department Layer 22Since departments start is in 31/3/2019, rolling average  of department from latest report date backwards till 31/3/2019
-Department Layer 21Since departments start is in 30/06/2019, rolling average  of department from latest report date backwards till 30/06/2019

 

Thanks in advance

DJ

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Could you please explain more details about "latest report date backwards"?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy,

Thanks for the response!

 

Details:

eg: Headcount table has 12 months of data for a particular department, but the Departmnet table suggests that the start date of the department is just 3 months back, so when doing the  rolling average only consider the last three months of data.

In short consider the start date of the department from the department table while doing rolling average.

 

Thanks

Divya Joy

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Ashish,

 

I could open the file after upgrading my Power Bi desktop.
Thanks for the quick turnaround, the solution is perfect 🙂

 

Regards

DJ

 

 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

H Ashish,

 

My version of PBI is old, and i am not able to open this file. Any thoughts?

 

Thanks

DJ

 

No.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.