Forum Discussion

Eqa33's avatar
Eqa33
Brass Contributor
Dec 01, 2022
Solved

Power Query editor issue

I have data showing by product number in one column and sales by size in individual columns another words every size has its own column then I have columns with the same size names showing stock on hand by each size. How do I get one column to show size (once only), one column to show sales for each size and one column showing stock on hand for each size? 

 

Thanks for your help

 

 

  • Eqa33 Perhaps the attached file with a very basic table and query will get you on your way. It unpivots the initial table, Splits the original column headers (assuming they are structured as in the example) and then re-pivots the whole ending up with 4 columns (ProductNr, Size, Type [Sale or Stock] and Qty).

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Eqa33 Perhaps the attached file with a very basic table and query will get you on your way. It unpivots the initial table, Splits the original column headers (assuming they are structured as in the example) and then re-pivots the whole ending up with 4 columns (ProductNr, Size, Type [Sale or Stock] and Qty).

    • Eqa33's avatar
      Eqa33
      Brass Contributor

      Riny_van_Eekelen Thanks for your reply. Your example is correct. Once I have unpivoted the entire Table I end up with the example below. How or what do I split these 2 columns into, to extract inorder to end up as your example?

       

      Thanks again

Resources