Forum Discussion
I need help with using Power Query
- 11 months ago
Hi E12345, you need a combination of transpose/pivot/filldown to achieve what you are trying to do
Step 1: Your starting point should look like this ideally => years not in the headers, so we can easily use Transpose + Fill Down in the next steps:Step 2: Click on Column1 and apply Transform > Transpose. This will give you a new Column1 with one row for each year + a blank row below it. Use Transform > Replace Value if the empty rows (2, 4, 6 and 😎 are not null but blank (= look empty)
Step 3: Select Column1 and apply Transform > Fill > Down to fill the year-values into your null-rows:
Step 4: Select Column1 + Column2 and apply Transform > Unpivot Columns > Unpivot other Columns:
Step 5: Now Select Column2 (the one with the the values Course and Completions) and apply Transform > Pivot Column. Set the "Values Column" to "Value" (the one with Course A, 34 etc) and open the Advanced options to select "Don't Aggregate"
Step 6: Rename the Columns as needed, delete the extra column "Attribute" and adjust the datatypes as needed:
I hope that helps!
Hi E12345,
Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to ralf_anton, KarinSzilagyi, tharunkumarRTK & Riny_vE for sharing valuable insights.
Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.
Thank you for being part of the Microsoft Fabric Community.