Forum Discussion

rohitthb's avatar
rohitthb
Frequent Visitor
9 years ago
Solved

How to do aggregation in column values instead of rows

Hi,   I am a bit novice in power BI and just starting up.   What I basically want to know is if summation/count etc can be put in first column rather than adding them in rows? This is how it loo...
  • MFelix's avatar
    MFelix
    9 years ago

    Hi rohitthb,

     

    Looking at your data I believe that the best way to do this is to unpivot the information you have and then do the matrix, this because if you add the columns you want to calculate to the matrix visual you will get the calculations but the name will not be there, again this is based on the information you made available.

     

    I the Power Query view do as follow:

    - Select all the columns to be calculated

    - Unpivot columns

     

    This will give you a new format with:

    - City

    - Value

    - Yearmon

    - Attribute - As the name of the columns # bills, # Customers,...

     

    Then just add YearMon as columns, Value as value and attibute as Columns. You can then filter the attibute in the matrix visual if you don't want everything to show in the table or add a slicer. check the print screnns below.

     

     

    Regards,

     

    MFelix