Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello there,
I am a bit stumped on the best way to achieve what I require. My data needs to "unpivot" but I put this in quotes because every time I try this, the results are not what I need.
My data
The data I have is being imported into Power BI (desktop) from a SQL server. The data is arranged as follows:
| Company Name | Assets under Management | Asset Class 1 | Asset Class 2 | Asset Class 3 | 
| Acme | 1000 | Maintain | Increase | Decrease | 
| Balsam | 500 | Increase | Increase | No Exposure | 
| Charca | 2000 | Decrease | Decrease | Increase | 
The requirement
What I would like to have is a visualisation showing count of companies by sentiment and asset class - something like this:
| Sentiment | Asset Class 1 | Asset Class 2 | Asset Class 3 | 
| Increase | 1 | 2 | 1 | 
| Maintain | 1 | 0 | 0 | 
| Decrease | 1 | 1 | 1 | 
| No Exposure | 0 | 0 | 1 | 
I also want to be able to show this as total Assets under management by sentiment and asset class.
The issue
I believe that I will need my data to be arranged as follows in order to achieve this. But I don't know if I can do this using Power Query or if I will need to write some kind of SQL code to "unpivot" my data to look like this.
| Company | Asset Class | Sentiment | Assets under Management | 
| Acme | Asset Class 1 | Maintain | 1000 | 
| Balsa | Asset Class 1 | Increase | 500 | 
| Charca | Asset Class 1 | Decrease | 2000 | 
Acme  | Asset Class 2 | Increase | 1000 | 
| Balsa | Asset Class 2 | Increase | 500 | 
| Charca | Asset Class 2 | Decrease | 2000 | 
| Acme | Asset Class 3 | Decrease | 1000 | 
| Balsa | Asset Class 3 | No exposure | 500 | 
| Charka | Asset Class 3 | Increase | 2000 | 
I'd appreciate any suggestions on how to achieve this.
Thanks
Solved! Go to Solution.
try this code to transform your data
NewStep=Table.UnpivotOtherColumns(PreviousStepName,{"Company","Assets under Management"},"Class","Sentiment")
and, create a matrix vasual, put the column of Sentiment into its Row area, and put the column of Class into its Column area, and measure to Value area.
Thank you @wdx223_Daniel ! You got me on the right path.
What I did was I selected the columns Asset Class 1, Asset Class 2, Asset Class 3. I then chose to "Unpivot selected columns". I then had to rename the column headers and that was it! So easy! Thank you!
try this code to transform your data
NewStep=Table.UnpivotOtherColumns(PreviousStepName,{"Company","Assets under Management"},"Class","Sentiment")
and, create a matrix vasual, put the column of Sentiment into its Row area, and put the column of Class into its Column area, and measure to Value area.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.