Forum Discussion

Jean_LucGUE's avatar
Jean_LucGUE
Frequent Visitor
4 years ago
Solved

Month-to-Month Change With Multiple Values

Hi all - i am trying to display month-to-month percentage for Multiple values (A, B, C) stored in the same colunm.  Month IdAttribute Attribute Value June 1 A 200 June 2 B 100 J...
  • Hoangechip910's avatar
    4 years ago

    Hi

    you need a common Date table, to use  PREVIOUSMONTH

     

    total =SUM (value)

    value_percent =

       var a = SELECTEDVAUE (attribute)

    return SWITCH (a,

                            "A", blank(),
                            "B", total / CALCULATE (total, REMOVEFILTER (attribute), attribute = "A", PREVIOUSMONTH (Date)),
                            "C", total / CALCULATE (total, REMOVEFILTER (attribute), attribute = "B", PREVIOUSMONTH (Date)),

                            blank() )

     

    Creata Matrix with month and attribute like you show, and add "value_percent' as value