Forum Discussion
Stacking Data Columns
- 1 month ago
Yes, this is a common scenario. Since your 1st, 2nd, and 3rd Reason for Leaving columns all contain the same list of values, the best approach is to unpivot these columns in Power Query. This converts them into a single "Reason" column, making it easy to count how many times each reason was selected regardless of whether it was the 1st, 2nd, or 3rd choice.
Recommended approach: Unpivot the columns
In Power BI Desktop, go to Transform Data to open Power Query.
Select the three columns:
1st Reason
2nd Reason
3rd Reason
Right-click the selected columns and choose Unpivot Columns.
Power Query will create:
Attribute (e.g., 1st Reason, 2nd Reason, 3rd Reason)
Value (the actual reason selected)
Rename Value to Reason (and Attribute if desired).
Remove any blank/null rows.
Close & Apply.
Your data will change from:
Employee 1st Reason 2nd Reason 3rd Reason
A Family Concerns Salary Career Growth B Salary Family Concerns Family Concerns to:
Employee Reason Rank Reason
A 1st Reason Family Concerns A 2nd Reason Salary A 3rd Reason Career Growth B 1st Reason Salary B 2nd Reason Family Concerns B 3rd Reason Family Concerns Now you can simply create a bar chart with:
Axis: Reason
Values: Count of Reason
In this example, Family Concerns would correctly show a count of 3 because it was selected three times across all responses.
This approach is scalable, easy to maintain, and is the standard Power BI method for survey data where multiple columns represent the same type of response.
For more information:
Unpivot columns in Power Query: https://learn.microsoft.com/power-query/unpivot-column
Power Query documentation: https://learn.microsoft.com/power-query/
💡 Helpful? Give a Kudos 👍 — keep the community growing.
✅ Solved your issue? Mark this as the Accepted Solution ✔️
Best regards, Prince Singh | Data Science & Microsoft Fabric Enthusiast