Forum Discussion

mkim's avatar
mkim
Regular Visitor
5 years ago
Solved

Create a calculated column in matrix visualization

I've been reading other forums but still am not able to figure it out. I'm looking to create a new measure subtracting the first column (2011-12) from the last column (2015-16). How do I calculate th...
  • Fowmy's avatar
    5 years ago

    mkim 

    Adding a Measure to a Matrix will always show calculation against each Row and Column fields, to hide the values, you can create the following measure, adjust your measure accordingly:

    Diff = 
    IF(
        ISFILTERED( Table3[YEAR] ) , "" , 
        CALCULATE(
            SUM(Table3[VALUE]),
            Table3[YEAR] = 2016
        ) - 
        CALCULATE(
            SUM(Table3[VALUE]),
            Table3[YEAR] = 2014
        )
    )

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn



  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi mkim ï¼Œ

     

    Based on your description, you can do some steps as follows.

    1. Create an index column.
    2. Create two date tables.

     

    Current date = SUMMARIZE('Case3',Case3[index],Case3[DATE])

    Prior date = SUMMARIZE('Case3',Case3[index],Case3[DATE])

     

    3. Create a measure.

     

    diff =

    var cu1=MIN('Current date'[index])

    var cu2=MAX('Current date'[index])

    var pr1=MIN('Prior date'[index])

    var pr2=MAX('Prior date'[index])

    return

    CALCULATE(SUM(Case3[VALUE]),'Case3'[index]>=cu1&&'Case3'[index]<=cu2)-CALCULATE(SUM(Case3[VALUE]),'Case3'[index]>=pr1&&'Case3'[index]<=pr2)

      4.Create two clicers.

    Result:

     

     

    Hope that's what you were looking for.

    Best Regards,

    Yuna

     

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