Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help with Global Measures

Hi All, 

 

I have some data that looks something like so:

 

Prior Year`Sales300FY20
Fee RevenueSales100

FY20

 

I want to be able to show in a matrix the growth percentage for each row level, with the "Prior Year" amount as the basis. So, for this example, id see

 

Prior Year3001.00
Fee Revenue100.33

 

I created a measure for Prior year using CALCULATE(SUM(Value), FY = "Prior Year") but then that only shows up for rows where the line ite is "prior year". 

 

Is there a best practice way to do this? I know the data is uncoventional, should i perhaps try deriving a date column?

 

Thanks!

  • Hi, Anonymous 

    According to your description, I can understand clearly what you want to get, you want to create a Matrix to show in a matrix the growth percentage for each row-level, right? I think you can try my steps:

    This is my test data based on your sample data:

     

    1. To get the row number of each row in the table, I click “Transform data” to go to the Power query to add an index column in the table:

     

    1. I created a measure:
    growth percentage =
    
    var _lastrow=
    
    CALCULATE(MAX('Table'[Amount]),FILTER(ALL('Table'),[Index]=MAX([Index])-1))
    
    return
    
    IF(_lastrow=BLANK(),
    
    DIVIDE(MAX([Amount]),MAX([Amount])),
    
    DIVIDE(MAX([Amount]),_lastrow
    
    ))
    1. I created a matrix chart and placed it like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result so that we can help you in advance.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

1 Reply

  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, Anonymous 

    According to your description, I can understand clearly what you want to get, you want to create a Matrix to show in a matrix the growth percentage for each row-level, right? I think you can try my steps:

    This is my test data based on your sample data:

     

    1. To get the row number of each row in the table, I click “Transform data” to go to the Power query to add an index column in the table:

     

    1. I created a measure:
    growth percentage =
    
    var _lastrow=
    
    CALCULATE(MAX('Table'[Amount]),FILTER(ALL('Table'),[Index]=MAX([Index])-1))
    
    return
    
    IF(_lastrow=BLANK(),
    
    DIVIDE(MAX([Amount]),MAX([Amount])),
    
    DIVIDE(MAX([Amount]),_lastrow
    
    ))
    1. I created a matrix chart and placed it like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result so that we can help you in advance.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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