Forum Discussion

Nonzy's avatar
Nonzy
Icon for Helper I rankHelper I
2 years ago
Solved

Totals are wrongly measured.

Hi, 

 

Not an expert in PBI, need your help! 

 

I am doing a simple YOY analysis where I have Total Aloc as total sales and LY Total aloc as last year total sales. I have YOY as difference between both. Total of YOY is showing incorrectly. It should be -13M as per the 3 values shown. Not sure why it is showing like this. Can you please support on this? 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Nonzy ,

    First of all, many thanks to  for your very quick and effective replies.
    Based on my testing, because the YOY is calculated by Total – LY total, so the last row Total is error.

    I will give some additions below:

    1.Create the sample table.

    2.Create the new measure to calculate difference.

    Difference = 
    VAR cur_total = SUMX('Table', 'Table'[Total Aloc order])
    VAR ly_total = SUMX('Table', 'Table'[LY Total Aloc order])
    VAR result = cur_total - ly_total
    RETURN
    IF(ISBLANK(ly_total), BLANK(), result)

    3.Create the new measure to calculate YOY total.

    YOY = SUMX('Table', [Difference])

    4.Drag the new measure into the table visual. The result is shown below.

     

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • maybe try this

    measure=sumx(values(Date.N), [YOY])

    • Nonzy's avatar
      Nonzy
      Icon for Helper I rankHelper I

      Thanks a lot Ryan, it worked. Quick one on the same, I am also trying to do YOY% and tried using your solution but it doesn't work. Should I do something differently? for YOY%, it is showing Infinity. 

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Nonzy ,

    First of all, many thanks to  for your very quick and effective replies.
    Based on my testing, because the YOY is calculated by Total – LY total, so the last row Total is error.

    I will give some additions below:

    1.Create the sample table.

    2.Create the new measure to calculate difference.

    Difference = 
    VAR cur_total = SUMX('Table', 'Table'[Total Aloc order])
    VAR ly_total = SUMX('Table', 'Table'[LY Total Aloc order])
    VAR result = cur_total - ly_total
    RETURN
    IF(ISBLANK(ly_total), BLANK(), result)

    3.Create the new measure to calculate YOY total.

    YOY = SUMX('Table', [Difference])

    4.Drag the new measure into the table visual. The result is shown below.

     

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.