Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Difference in Matrix instead of Total

I have problem, but I can't solve it.  I made matrix from table with values for places each year. I get Total in column to right but I need difference between column nr. 2 and 10 and ratio in next column.  I don't find solution for that.

 

My example in Matrix table

Place           2011       2012...........2019   Total(but I need difference)

East coast     10.605                  11.254    21.859 (649)

 

How do I solve this?

 

Best regards,

Jóhannes Finnur

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous ,

    You can use measure formula with if statement to check current row contents level and apply specific calculation formula if they are on total level and use normal summary formula on other levels. (replace original value field)

    Measure Totals, The Final Word

    After these steps, you can enter to 'subtotals -> column subtotals label' to custom the total level label.

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, but can you show me the DAX formula.  I'm beginner in DAX

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your answer. In the solution to make new date table?

  • Hi,

    See if this measure helps

    =IF(HASONEVALUE(Data[Place]),[your measure],CALCULATE([your measure],LASTDATE(Calendar[Date]))-CALCULATE([your measure],FIRSTDATE(Calendar[Date])))

    You shoould have a Calendar Table and an active relationship between the Date column of your Data Table to the Date column of the Calnedar Table.  In the Calendar Table, write this calculated column formula to extract the year

    Year = Year(Calendar[Date])

    To your visual, drag the Year field from the Calendar Table.

    Hope this helps.