Forum Discussion

cheeto92's avatar
cheeto92
Frequent Visitor
2 years ago

DAX for Week Over Week comparison between two years

Hi Everyone. I have a task where I need to calculate week over week lease renewal comparions between two years and broken down by Regions.

In my Renewal Report table I have a column named "Signed Date" where I can see that if there's a date in that row it means that there was a renewal signed. The below DAX calculcates for year over year but not week over week. I created a Calendar table that contains "Date" "Month""WeekNo" and "Year". The Calendar table has a One to Many relationship with the Renewal Report table. can someone pleaseee help! Thank you

Renewals_Current_and_Previous_FY_Percentage =

VAR Renewals_Current_FY =

    CALCULATE(

        COUNTROWS('Renewal Report'),

        FILTER(

            'Renewal Report',

            'Renewal Report'[FY] = 2024 && 'Renewal Report'[Signed Date] >= MIN('Calendar'[Date]) && 'Renewal Report'[Signed Date] <= MAX('Calendar'[Date])

        )

    )

 

VAR Renewals_Previous_FY =

    CALCULATE(

        COUNTROWS('Renewal Report'),

        FILTER(

            'Renewal Report',

            'Renewal Report'[FY] = 2023 && 'Renewal Report'[Signed Date] >= MIN('Calendar'[Date]) && 'Renewal Report'[Signed Date] <= MAX('Calendar'[Date])

        )

    )

 

VAR Total_Renewals = Renewals_Current_FY + Renewals_Previous_FY

VAR Total_Entries = COUNTROWS('Renewal Report')

12 Replies

    • cheeto92's avatar
      cheeto92
      Frequent Visitor
      Fiscal YearRenewals Signed DateRegions (Central, West, East)
      202302/05/23Central
      202302/03/23Central
      202302/02/23Central
      202402/02/24Central
      202402/02/24Central
      202402/02/24Central
      202402/02/24Central
    • cheeto92's avatar
      cheeto92
      Frequent Visitor

           

       

      The excel table and the chart is what i need to recreate in Power BI. I created two measures in Power BI like this: 

      Signed_Renewals_2023 =
          CALCULATE(
              COUNTROWS('Renewal Report'),
              FILTER(
                  'Renewal Report',
                  'Renewal Report'[FY] = 2023 &&
                  NOT(ISBLANK('Renewal Report'[Renewals Signed Date]))
              )
          )
      Signed_Renewals_2024 =
          CALCULATE(
              COUNTROWS('Renewal Report'),
              FILTER(
                  'Renewal Report',
                  'Renewal Report'[FY] = 2024 &&
                  NOT(ISBLANK('Renewal Report'[Renewals Signed Date]))
              )
          )
       

      I need to show the %ofRenewals signed this week last year vs %of Renewals signed this week of current year. This is what the bar chart is showing for the central region