Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

hiding YOY difference for future dates

Hi,   I'm trying to do a calculation of YOY actual difference.  I am able to not calculate future months but the total is not correct.  I think I need to use a SUMX instead but not sure how to writ...
  • Ashish_Mathur's avatar
    5 years ago

    Hi,

    Does this measure work?

    Measure = SUMX(SUMMARIZE(Calendar,Calendar[Year],Calendar[Month],"ABCD",[diff YoY Acctual]),[ABCD])

    If it does not, then share the link from where i can download your PBI file.

  • Ashish_Mathur's avatar
    Ashish_Mathur
    5 years ago

    Hi,

    You may download my PBI file from here.

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello Ashish,

     

    in the dummy file I created a custom column called month name in the calendar table, then used the measure you created 

     

    Month number = MONTH('calendar'[calendar])
    Measure = SUMX(SUMMARIZE('calendar','calendar'[Year],'calendar'[Month Name],"ABCD",[diff yoy amount]),[ABCD])
     
    but I could not get the total to calculate correctly.  also, if I use the Month name and Year in the calendar table separatly (w/o date hiearchy) i can not longer sort on the year.  did you make any other changes to the file?  I'd like to understand what changes were made so I can implment the code to actual data.