Forum Discussion

Ninja_Powered's avatar
Ninja_Powered
Frequent Visitor
2 years ago
Solved

DAX Measure for Open Issues Previous Week

My data source has a list of issues - each with an open date and a close date. I have (with the help of others) created a DAX measure that returns the number of issues open in a week, ie 2023 week 51 1000 issues were open (opened throughout the year not just week 51).

 

However, to make the visuals in my page work I need a seperate measure that automatically calculates the number of issues open in the previous week. I've tried to modify the formula below with no sucess. My date table has a week offset column I was trying to use... 

 

IssuesOpenInWeek = 
CALCULATE(
DISTINCTCOUNT('Issues'[ISSUE NUMBER]),
'Date Table'[End of Week] <= MAX('Date Table'[End of Week]),
REMOVEFILTERS('Date Table'[End of Week], 'Date Table'[Week Number]),
'Issues'[ISSUECLOSEDDATE] >= MAX('Date Table'[End of Week]) || 
ISBLANK('Issues'[ISSUECLOSEDDATE))

 

5 Replies

  • What is your definition of week?  Does your date table have a yearweek column?

     

    Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

    • Ninja_Powered's avatar
      Ninja_Powered
      Frequent Visitor

      lbendlin this is a simplied version of my data: 

       

      IDDate OpenDate ClosedDepartment
      107/02/2024 Department 6
      224/01/202404/03/2024Department 6
      324/01/2024 Department 6
      424/01/202404/03/2024Department 6
      524/01/202404/03/2024Department 6
      624/01/202404/03/2024Department 6
      724/01/2024 Department 6
      819/01/2024 Department 2
      919/01/2024 Department 2
      1019/01/2024 Department 6
      1119/01/202427/02/2024Department 7
      1219/01/2024 Department 8
      1308/01/202425/01/2024Department 1
      1403/01/2024 Department 3
      1503/01/202409/01/2024Department 4
      1603/01/202417/01/2024Department 5
      1703/01/202421/02/2024Department 5
      1803/01/2024 Department 7
      1903/01/202414/02/2024Department 8
      2003/01/2024 Department 9
      2103/01/202411/01/2024Department 10
      • lbendlin's avatar
        lbendlin
        Super User

        Thank you. PLease also indicate YearWeek numbers and add sample data where issues were opened in December 2023.