Forum Discussion

ethanlsaul's avatar
ethanlsaul
Helper I
4 years ago
Solved

Pivot/Unpivot Data

Hello,

 

I have tried every combo of pivot, transpose, unpivot. I want my data to go from 

 

ProductPlantQty
123US10100
123US20200
123US30111
456US1026
456US2033
456US3056
789US10700
789US20600
789US30555

 

To this:

 

ProductUS10US20US30
123100200111
456223356
789700600555
  • Hi, ethanlsaul ;

    You could use pivot it.and the seting as follow:

    The final show:

     


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

    • ethanlsaul's avatar
      ethanlsaul
      Helper I

      Hi GilbertQ,

      Thanks for replying. It worked, sort of! 

       

      Do you know how i would go about replacing the blanks with 0's. The tricky part here is that the data isn't null for the missing column. 3rd row, 2nd line-- there isn't a line that contains anything in the raw data for that plant + item combo. I think it needs some sort of measure, but i have failed all week to figure it out. I wrote it here: Missing Data in inputs resulting in blanks on Matr... - Microsoft Power BI Community 

       

       

      • GilbertQ's avatar
        GilbertQ
        Super User

        Hi ethanlsaul 

         

        What you could do is to create a measure and where it finds a blank to replace it with zero as shown with the example below

         

        Qty (With Zeros) = IF(ISBLANK('Table Name'[Qty]),0,SUM('Table Name'[Qty]))
  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, ethanlsaul ;

    You could use pivot it.and the seting as follow:

    The final show:

     


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.