cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jean_LucGUE
Regular Visitor

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. 

MonthIdAttributeAttributeValue
June1A200
June2B100
June3C200
July1A50
July2B25
July3C500
August1A30
August2B250
August3C115

 

Or 

 ABC
June200100200
July5025500
August30250115

 

The value of B obtained in July is the result of the evolution of the value of A in June.
I would like to perform a Month/Month percentage calculation of B versus A and C versus B.
Simply: B (July)/A(June) = __% or C (July)/B(June) = __%

 

Do you have any tips (DAX measures) that could help me with this calculation?

Thanks in adavance.

2 ACCEPTED SOLUTIONS
Vera_33
Super User
Super User

@Jean_LucGUE 

 

Here is one way, .pbix file attached

Vera_33_0-1659878253340.png

 

View solution in original post

Hoangechip910
Frequent Visitor

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

 

View solution in original post

3 REPLIES 3
Hoangechip910
Frequent Visitor

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

 

Jean_LucGUE
Regular Visitor

Hello @Vera_33 , thank you very much for your answer.
However my main difficulty is that I would like to have a measure that works no matter which attribute is chosen, not only for B/A.
That is to say, a measure capable of producing the following result:

 ABC
July B/AC/B
Vera_33
Super User
Super User

@Jean_LucGUE 

 

Here is one way, .pbix file attached

Vera_33_0-1659878253340.png

 

Helpful resources

Announcements
collabdays lisbon

CollabDays Lisbon - 26 November 2022

Sessions include practical, hands-on experience that will help you take the next step in your career and know-how.

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.