Forum Discussion

umairarshad's avatar
umairarshad
Helper II
1 year ago
Solved

Column to row conversion

Hello all,

I have a data set as below.

 

 

and i want the to covert it like following 

 

i.e. date should be in columns and each GSE must have the correct consumption.

 

Pleae advise how to do it

  • Hi umairarshad 
    Thanks for reaching out to the Microsoft fabric community forum.
    As mentioned by jennratten   you can use matrix to get your desired visual consisting of dates as columns but if you are trying to transform the underlying data itself use pivot column.
    For the sample data I took, Pivoting the date column over Quantity column worked as per your requirement

     

     

     



    Did I answer your question? Mark my post as a solution, this will help others!

    If my response(s) assisted you in any way, don't forget to give "Kudos"

    Thanks and Regards

4 Replies

  • Hello umairarshad  - thanks for posting to the community forum.

    To achieve the desired result you essentially need to add a column for the day number of the month based on the date column, then use a matrix visual.  Add the new Day column to the matrix olumns, add any pertinate descriptive/dimension columns to the matrix rows and add the value to be summarized to the matrix values.

    • To add a column in Power Query to the table for the 'Day of Month' which returns the day number based on the date for the row. 
      • Select the Date column in your table
      • On the ribbon, choose Add Column > Date > Day > Day

    Example:

    Please let me know if you have any other questions about this solution or how to use it in your scenario.

    • umairarshad's avatar
      umairarshad
      Helper II

      Thank you Jenn for the prompt response. At the moment, i am not using PBI for it. I need to do it in excel power query.

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

    Hi umairarshad 
    Thanks for reaching out to the Microsoft fabric community forum.
    As mentioned by jennratten   you can use matrix to get your desired visual consisting of dates as columns but if you are trying to transform the underlying data itself use pivot column.
    For the sample data I took, Pivoting the date column over Quantity column worked as per your requirement

     

     

     



    Did I answer your question? Mark my post as a solution, this will help others!

    If my response(s) assisted you in any way, don't forget to give "Kudos"

    Thanks and Regards