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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
bunny18
Helper I
Helper I

Weekly defect inflow/outflow in power bi - Need help

Hi,

I need to plot a weekly inflow/outflow of defects using data in Azure. My data set has the following  columns :

Defect ID, Created Date, Resolved Date

 

Using this, I have to create a  Weekly chart (by work week) which will have Total bugs cummulative, Resolved Cummulative, Open as of that week. Attached is the data set and also sample chart that am trying to achieve in Power BI.

 

https://drive.google.com/file/d/18QpjkMZNVTh0HjgXH9lYqLP_CwUgEYEW/view?usp=sharing

 

Looking forward for some quick help.

 

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Typically, this pattern is served by a Dates table with an active relationship to one of its dates and an inactive relationship to the other. Measures are then created and, in the second measure, USERELATIONSHIP() is specified to change the relationship dynamically.

Do you have a date table (calendar)? Are the actual date fields Creation Date and Resolved Date or are they datetime fields? Are you looking for a solution without the need for a Dates table?

What is your definition of a week's work?

https://community.powerbi.com/t5/Community-Blog/It-s-the-weekend-Or-is-it/ba-p/1216125

View solution in original post

Hi @bunny18 

 

Firstly, plz add the monthnumber column:

weeknum = WEEKNUM('Table'[Created Date],2)

Then try something like below measures:

Total Cummulative = CALCULATE(SUMX(FILTER(ALL('Table'),[Created Date]<=MAX('Table'[Created Date])&&[weeknum]=MAX('Table'[weeknum])),DISTINCTCOUNT('Table'[Defect ID])))
total open cumulative = CALCULATE(SUMX(FILTER(ALL('Table'),[Created Date]<=MAX('Table'[Created Date])&&[weeknum]=MAX('Table'[weeknum])&&[State]="On hold"),DISTINCTCOUNT('Table'[Defect ID])))
total resolved cumulative = CALCULATE(SUMX(FILTER(ALL('Table'),[Created Date]<=MAX('Table'[Created Date])&&[weeknum]=MAX('Table'[weeknum])&&[State]="Resolved"),DISTINCTCOUNT('Table'[Defect ID])))

 

 06.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Weekly defect inflow/outflow calculation does not seem to work on the data where we don't have any end date . How to make it work for some short set of data .  Ex:- in below table , Status [Analysis/In progress/Comitted:- Inflow] wheres Status [Ready for Integration/ready for review/Re-test :- Outflow] at the same time how to proceed for new defects inflow each week ? any help apreciate in this context .

IdStatusCreation DateWEEKNUM
1723064Ready for Integration8/31/2023 9:3235
1717946Analysis8/28/2023 9:4335
1717286Analysis8/25/2023 22:0234
1716472Analysis8/25/2023 1:3934
1709465Analysis8/23/2023 1:3034
1709448Analysis8/23/2023 1:2034
1709311Analysis8/22/2023 21:5734
1707948Ready for Integration8/22/2023 10:3434
1706241Analysis8/20/2023 21:5334
1704453Analysis8/17/2023 7:2233
1704227Analysis8/17/2023 3:1033
1700381Committed8/11/2023 10:4732
1692837Analysis8/9/2023 1:4432
1686467Re-Test8/2/2023 10:4631
1686119Analysis8/2/2023 9:2031
1683907Analysis8/1/2023 8:4131
1681967Ready for Integration7/31/2023 9:1531
1681261Analysis7/29/2023 16:4730
1681260Committed7/29/2023 16:2230
1680134Analysis7/27/2023 22:5030
1678152Analysis7/27/2023 3:3130
1677800Committed7/26/2023 21:3530
1669951Analysis7/25/2023 10:0530
1663141In Progress7/23/2023 17:1830
1663091Analysis7/23/2023 16:0030
1663090In Progress7/23/2023 15:2230
1658606Ready for Review7/21/2023 4:3329
1655819Analysis7/20/2023 11:0429
1655652Analysis7/20/2023 10:4229
1652642Analysis7/19/2023 23:5329
1646310Ready for Review7/19/2023 2:2629
1646291Ready for Integration7/19/2023 2:1529
1646271Ready for Integration7/19/2023 2:0829
1637152Analysis7/14/2023 1:5928
1637141Analysis7/14/2023 1:1828
1637018Re-Test7/13/2023 22:2428
1636268Ready for Integration7/13/2023 11:0428
1636076Ready for Integration7/13/2023 9:5528
1635521Re-Test7/13/2023 6:4228
1635333Committed7/13/2023 4:2228
1635142Ready for Integration7/13/2023 1:5128
1632183Re-Test7/12/2023 10:0628
1623481Ready for Integration7/5/2023 8:4527
1621005Ready for Review7/3/2023 5:1927
1609486Analysis6/27/2023 0:5926
1609485Committed6/27/2023 0:5526
1605492Re-Test6/22/2023 5:1425
1602809Committed6/21/2023 1:2825
1602080Analysis6/20/2023 11:2525
1600975Re-Test6/20/2023 1:3225
1597994Ready for Review6/16/2023 11:4024
1597953Analysis6/16/2023 11:2024
1597301Ready for Integration6/16/2023 6:2724
1596741Ready for Review6/16/2023 1:0124
1596022Analysis6/15/2023 13:5624
1595937Analysis6/15/2023 13:1224
1595911Committed6/15/2023 12:5924
1595743Ready for Integration6/15/2023 11:3324
1595604Ready for Integration6/15/2023 10:2724
1595490Ready for Integration6/15/2023 9:5424
1595187Committed6/15/2023 8:3724
1594481Ready for Integration6/15/2023 5:1024
1594326Ready for Integration6/15/2023 4:0024
1586562Ready for Integration6/14/2023 8:5724
1586471Ready for Integration6/14/2023 8:4624
1578183Ready for Integration6/9/2023 6:0823
1572794Analysis6/5/2023 0:2723
1572205Committed6/2/2023 9:1822
1571945Ready for Integration6/2/2023 5:1522
1570991Analysis6/1/2023 8:1622
1563849Re-Test5/31/2023 4:1322
1561164Ready for Integration5/30/2023 6:3422
1560676Ready for Integration5/30/2023 2:4722
1559839Ready for Integration5/28/2023 21:0222
1559019Analysis5/26/2023 1:5121
1553708Ready for Review5/18/2023 6:5720
1553695Ready for Integration5/18/2023 6:5220
1553526Ready for Integration5/18/2023 4:4620
1548333Ready for Integration5/17/2023 8:1220
1542383Committed5/11/2023 10:4419
1540268Re-Test5/9/2023 3:3619
1540254Re-Test5/9/2023 3:2319
1527204Ready for Integration5/1/2023 22:4618
1524447Committed4/26/2023 12:5017
1524169Re-Test4/26/2023 8:3317
1506515Re-Test4/18/2023 2:5516
1494296Re-Test4/14/2023 6:2515
1467378Ready for Integration3/31/2023 10:1713
1437540Re-Test3/13/2023 8:1911
1436521Re-Test3/10/2023 5:5010
v-diye-msft
Community Support
Community Support

Hi,

Thankyou! I created a Dates table as follows :

I went through the links that you shared, and tried using the formulas (modified) but it didnt work for me.

 

Date TableDate Table

 

Based on the attached Data from Azure, I need one chart that shows weekly ((by Year & Week Number)) trend of

Total Cummulative 

Total Resolved Cummulative

Open 

Datafrom Azure.PNG

 

 

The Bug state in the azure data has multiple states (New, Assigned,Implemented) which will give the 'Open'

And Resolved & Closed (having resolved date) that will be the Total resolved cummulative.

how can I achieve this ?

 

Hi @bunny18 

 

It's hard to imagine the issue you met now, would you mind kindly share the dummy pbix that I can invertigate it and draw it up on it?

You can upload it to the onedrive for business and share the link here. please don't forget to disclose the expected results and remove the confidential info.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Thank you so much.

I have uploaded the .pbix and also the sample excel data which I currently compute manually for charts. Chart 1 & Chart 2 (in excel) is my desired output from BI data.

 

https://drive.google.com/drive/folders/1ZwiV022tY8IaKU4Kup09BX5ABEc0JJTr?usp=sharing

 

Hi @bunny18 

 

Firstly, plz add the monthnumber column:

weeknum = WEEKNUM('Table'[Created Date],2)

Then try something like below measures:

Total Cummulative = CALCULATE(SUMX(FILTER(ALL('Table'),[Created Date]<=MAX('Table'[Created Date])&&[weeknum]=MAX('Table'[weeknum])),DISTINCTCOUNT('Table'[Defect ID])))
total open cumulative = CALCULATE(SUMX(FILTER(ALL('Table'),[Created Date]<=MAX('Table'[Created Date])&&[weeknum]=MAX('Table'[weeknum])&&[State]="On hold"),DISTINCTCOUNT('Table'[Defect ID])))
total resolved cumulative = CALCULATE(SUMX(FILTER(ALL('Table'),[Created Date]<=MAX('Table'[Created Date])&&[weeknum]=MAX('Table'[weeknum])&&[State]="Resolved"),DISTINCTCOUNT('Table'[Defect ID])))

 

 06.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
lbendlin
Super User
Super User

Typically, this pattern is served by a Dates table with an active relationship to one of its dates and an inactive relationship to the other. Measures are then created and, in the second measure, USERELATIONSHIP() is specified to change the relationship dynamically.

Do you have a date table (calendar)? Are the actual date fields Creation Date and Resolved Date or are they datetime fields? Are you looking for a solution without the need for a Dates table?

What is your definition of a week's work?

https://community.powerbi.com/t5/Community-Blog/It-s-the-weekend-Or-is-it/ba-p/1216125

The dates are as is from Azure DevOps report and I convert them into Week Number using the DAX formula in BI.

It's actually datetime field.datetime.PNG

 

I do not have calendar table and so would prefer to have a solution without the need for dates table.

Let me rephrase:  This will not work without a Dates table that has contiguous dates and has a clear designation of "week number"  based on your company's logic (across year and quarter boundaries!)  Using the DAX formula for week numbers is very risky.

Okay noted. So, will create the dates table. Could you please help provide a solution based on dates table.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors