Forum Discussion

gelkins81's avatar
gelkins81
New Member
1 year ago

Week Over Week Change for Scorecards

Hi everyone!

 

New to the forums and looking for some help.

I'm trying to have a WoW percent change scorecard underneath the main KPI scorecard, but having an issue with it returning the total result instead of the individual row result.  Here is an example screenshot:

 

Ignore the (Blank).  Those are from a previous build where I was doing MoM using Parallelperiod, which works great.  Unfortunately Parallelperiod doesn't, currently, support Weeks so this is not an option, to my knowledge.

 

As for my calculations:

 

Year Week =
VAR _YearCurrentRow = YEAR(Oneview[Date])
VAR _MonthCurrentRow = MONTH(Oneview[Date])
VAR _WeekCurrentRow = WEEKNUM(Oneview[Date],21)
VAR _YearReturn = IF(_WeekCurrentRow > 50 && _MonthCurrentRow = 1, _YearCurrentRow - 1, _YearCurrentRow)
RETURN
_YearReturn * 100 + _WeekCurrentRow

 

Oneview_Previous_Week_Impression = CALCULATE(SUM(Oneview[Oneview_Impressions]),OFFSET(-1,,ORDERBY('Oneview'[Year Week])))

Oneview_Previous_Week_Percent_Impressions =
CALCULATE(DIVIDE(SUM(Oneview[Oneview_Impressions])-[Oneview_Previous_Week_Impression],[Oneview_Previous_Week_Impression],0))
 
Any ideas from anyone?
 
Thanks in advance!

5 Replies

  • gelkins81 Calculate the Previous Week Impressions:

    Oneview_Previous_Week_Impression =
    CALCULATE(
    SUM(Oneview[Oneview_Impressions]),
    FILTER(
    Oneview,
    Oneview[YearWeek] = EARLIER(Oneview[YearWeek]) - 1
    )
    )

     

    Calculate the WoW Percent Change:

    Oneview_Previous_Week_Percent_Impressions =
    DIVIDE(
    SUM(Oneview[Oneview_Impressions]) - [Oneview_Previous_Week_Impression],
    [Oneview_Previous_Week_Impression],
    0
    )

    • gelkins81's avatar
      gelkins81
      New Member

      Thanks for such a quick response!

       

      I did try this solution, but am getting an error with the Earlier function:

       

      Thoughts?  Sorry, I am somewhat new to Dax as I used Tableau at my previous agency and where I am now uses PowerBi.  I've learned a lot over the past 6 months, but there's a lot of different functions that I just don't know about yet.  Thanks!

      • bhanu_gautam's avatar
        bhanu_gautam
        Super User

        Use DATE ADD instead of earlier 

        dax
        Oneview_Previous_Week_Impression =
        CALCULATE(
        SUM(Oneview[Oneview_Impressions]),
        DATEADD(Oneview[Date], -7, DAY)
        )