Forum Discussion

TejaThammu15's avatar
TejaThammu15
Regular Visitor
4 years ago
Solved

Calculating aggregations/percentages within the same table

Hello all,

 

I am a new user of power bi and seeking help with some calculations. I have a table with with hierarchy and I am looking for percentage calculations that should change as per my selection, the table is 

 

RegionCountrySchoolCampusYear1Year2
AsiaVietnamSchool1Campus1.114684
AsiaThailandSchool2Campus2.121339
AsiaSingaporeSchool3Campus3.19740
LatamBrazilSchool4Campus4.119441
EuropeSpainSchool5Campus5.143069
EuropeUKSchool6Campus6.17632
EuropeUKSchool6Campus6.26316
EuropeUKSchool6Campus6.333053

 

So I am to calculate percentage of change from Year1 to Year 2, I created a column and which results as 

RegionCountrySchoolCampusYear1Year2Percentage(Year1/Year2)
AsiaVietnamSchool1Campus1.11468457.5
AsiaThailandSchool2Campus2.12133918
AsiaSingaporeSchool3Campus3.1974041
LatamBrazilSchool4Campus4.11944121
EuropeSpainSchool5Campus5.14306916
EuropeUKSchool6Campus6.1763242
EuropeUKSchool6Campus6.21468457.5
EuropeUKSchool6Campus6.32133918

 

When I try to show the above in a visual, campus level works fine however I would like the 'percentage' to work for school level too.

Could you please help with this?

 

 

Best Regards,

TTh

 

 

  • Hi TejaThammu15 ,

     

    Please create the measure:

     

    Measure = DIVIDE ( SUM ( 'Table'[Year2] ), SUM ( 'Table'[Year1] ) )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi TejaThammu15 ,

     

    Please create the measure:

     

    Measure = DIVIDE ( SUM ( 'Table'[Year2] ), SUM ( 'Table'[Year1] ) )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • TejaThammu15's avatar
      TejaThammu15
      Regular Visitor

      HI v-kkf-msft 

       

      Thanks for your message, It is what I needed and i did some changes as per my requirement. Thank you very much for your help 🙂