Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
DataSkills
Resolver I
Resolver I

Help with "unpivot" type of requirement

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 NameAssets under ManagementAsset Class 1Asset Class 2Asset Class 3
Acme1000MaintainIncreaseDecrease
Balsam500IncreaseIncreaseNo Exposure
Charca2000DecreaseDecreaseIncrease

 

The requirement

What I would like to have is a visualisation showing count of companies by sentiment and asset class - something like this:

SentimentAsset Class 1Asset Class 2Asset Class 3
Increase121
Maintain100
Decrease111
No Exposure001

 

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. 

 

CompanyAsset ClassSentimentAssets under Management
AcmeAsset Class 1Maintain1000
BalsaAsset Class 1Increase500
CharcaAsset Class 1Decrease2000

Acme

Asset Class 2Increase1000
BalsaAsset Class 2Increase500
CharcaAsset Class 2Decrease2000
AcmeAsset Class 3Decrease1000
BalsaAsset Class 3No exposure500
CharkaAsset Class 3Increase2000

 

I'd appreciate any suggestions on how to achieve this. 

 

Thanks

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

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.

View solution in original post

2 REPLIES 2
DataSkills
Resolver I
Resolver I

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!

wdx223_Daniel
Super User
Super User

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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.