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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
dogt1225
Helper III
Helper III

Week Ending Average Age of Open Requests

Hi All, 

I am looking to create a bar chart on PowerBI that shows the Week Ending Average Age of Open Requests.

 

For my company the Fiscal week begins on a Saturday and End on a Friday. Also the Fiscal Year begins on the 5th Saturday of the Calendar Year. (Example for FY17, it begins January 30th, 2016) The dates in my dataset begins in 2016 and is currently ongoing.
So my problem is I need to calcualate for the week ending that Friday of ALL the OPEN requests, what is the average age?
Here is what I have so far, but Ive noticed that instead of using TODAY() I will need to use the week ending date for that week. Any ideas on how to solve this? Please let me know if there is any missing details in my explanation above. Thank you!

 

 

 

Fiscal Week = CONCATENATE("Wk",
  IF(
  'Calendar'[Week Number] <= 5, 
  'Calendar'[Week Number] + 47, 
  'Calendar'[Week Number] - 5
  )
)   

 

 

 

 

 

Avg Age = [Cumulative Sum of Age (Open Request)] / [Total Open Request]

 

 

 

 

 

Cumulative Sum of Age (Open Request) = 
CALCULATE(
  SUMX(
   FILTER(DataTable, DataTable[Submitted_Date] <= MAX('Calendar'[Date]) && 
   (ISBLANK(DataTable[Date Resolved]) || DataTable[Date Resolved] >                                                   
   MAX('Calendar'[Date]))), DATEDIFF(DataTable[Submitted_Date], TODAY(), DAY)
  ),
  CROSSFILTER('Calendar'[Date], DataTable[Submitted_Date], None), 
  DataTable[Submission Type] <> BLANK(),
  DataTable[Submitted_Date] <> BLANK(),
  DataTable[Request Status] <> "Closed",
  DataTable[Request Status] <> "Resolved", 
  DataTable[Request Status] <> "Completed-Pending"
)

 

 

 

 

 

Total Open Request = 
CALCULATE(
  COUNT(DataTable[Submitted_Date]),
  DataTable[Submitted_Date] <> BLANK(), 
  DataTable[Submission Type] <> BLANK(),
  DataTable[Request Status] <> "Closed",
  DataTable[Request Status] <> "Resolved",
  DataTable[Request Status] <> "Completed-Pending", 
  FILTER(ALL('Calendar'), 'Calendar'[Date] <= MAX('Calendar'[Date]))
)

 

 

 

Sample Data:

IDSubmitted DateDate ResolvedRequest StatusSubmission Type
12/17/20208/26/2020ResolvedIdea 
22/27/20208/27/2020ClosedIdea 
34/29/2020 Re-AssignedIdea 
44/30/2020 Re-AssignedIdea 
55/4/2020 Re-AssignedIdea 
65/7/2020 Re-AssignedIdea 
75/22/2020 WorkingIdea 
86/4/2020 WorkingIdea 
96/10/2020 WorkingIdea 
106/11/2020 WorkingIdea 
117/9/2020 WorkingIdea 
127/14/2020 WorkingIdea 
137/21/2020 WorkingIdea 
148/4/2020 WorkingProcess
158/5/2020 WorkingProcess
168/10/20208/24/2020Completed-PendingProcess
178/11/20208/24/2020ClosedProcess
188/14/2020 WorkingProcess
198/19/2020 WorkingProcess
208/21/2020 WorkingProcess
218/24/2020 WorkingProcess
228/26/2020 WorkingIdea 
238/27/2020 WorkingIdea 
248/27/20208/28/2020ResolvedIdea 
252/9/2020 NewIdea 
265/20/2020 NewIdea 
277/4/2020 NewIdea 
288/10/2020 NewIdea 



1 ACCEPTED SOLUTION

@dogt1225 OK, if you have a Week Ending, then you should be able to use the built-in Running Total Quick Measure potentially. Otherwise, potentially:

Cumulative Measure = 
  VAR __Current = MAX([Week Ending])
RETURN
  SUMX(FILTER(ALL('Table'),[Week Ending]<__Current),[Measure])

[Measure] should be whatever you are doing now to calculate it non-cumulatively. Mileage may vary. You may need an ADDCOLUMNS wrapping your FILTER or even a SUMMARIZE. But I think if you use this for your measure:

DATEDIFF(MAX(DataTable[Submitted_Date]), TODAY(), DAY)

If you can post your sample data with the Week Ending you calculated I can try to mock it up and test it and be specific.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@dogt1225 Perhaps you can use this for Week Ending:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Week-Ending/m-p/389293



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@dogt1225 , if your problem is the week ending Friday. refer to this blog.

all types of the week are there

https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

How to deal with once have correct week

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Or video -https://youtu.be/e6Y-l_JtCq4

 

For what request that open by weekend you just need to display the data by week .

Refer to my HR blog for current Employee /Open Request would be the same

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak and @Greg_Deckler Thank you for the responses. 

I was able to create a Week Ending Date for my Calendar table, but I am still unsure how I will use that date to find the cumulative average for a given week.

@amitchandak Your link seems to go over comparing this week vs last week. Not quite what I am looking for. The math should be the Cumulative Sum of (Date Difference (Week End Selected - Submitted Date)) / Total Open requests for the week. Any ideas?

 

 

Week End Date = CALCULATE(
                    MIN([Date]), 
                    FILTER('Calendar', WEEKDAY([Date],2)=5 && 'Calendar'[Date]>=EARLIER('Calendar'[Date])
                    )
)

 

 

@dogt1225 OK, if you have a Week Ending, then you should be able to use the built-in Running Total Quick Measure potentially. Otherwise, potentially:

Cumulative Measure = 
  VAR __Current = MAX([Week Ending])
RETURN
  SUMX(FILTER(ALL('Table'),[Week Ending]<__Current),[Measure])

[Measure] should be whatever you are doing now to calculate it non-cumulatively. Mileage may vary. You may need an ADDCOLUMNS wrapping your FILTER or even a SUMMARIZE. But I think if you use this for your measure:

DATEDIFF(MAX(DataTable[Submitted_Date]), TODAY(), DAY)

If you can post your sample data with the Week Ending you calculated I can try to mock it up and test it and be specific.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors