Forum Discussion
Anonymous
1 year agoNot applicable
Pivot or Unpivot?
Hi All, I have in power query the following table Code Grp Name Qtr_Year 400 23 BGT Q1_2025 400 23 BGT Apple Now I want the below output Code Grp Name Qtr_Year Ctgy...
v-csrikanth
1 year agoCommunity Support
Hi Anonymous
Sorry for the late response.
Please do folow the mentioned points in detail to resolve your issue.
- Load your data into Power Query.
- Add an Index Column (Add Column → Index → From 1).
- Add a custom column called Is_Date with this formula:
= if Text.Contains([Qtr_Year], "Q") then "Yes" else "No" - Filter rows where Is_Date = Yes → keep this as Table_Qtr.
- Filter rows where Is_Date = No → keep this as Table_Ctgy.
- In both tables, keep the Index column.
- In Table_Qtr, rename Qtr_Year to Qtr_Year.
- In Table_Ctgy, rename Qtr_Year to Ctgy.
- Merge Table_Qtr with Table_Ctgy on Index using Inner Join.
- Expand the merged column and select only Ctgy.
- Remove Index and Is_Date columns.
- Final output will have columns: Code, Grp, Name, Qtr_Year, Ctgy.
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.