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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mitchpj75
Helper I
Helper I

Pivoting to get the correct data format for visuals

Hi,

 

Struggling with the right format of my data.  I have 2 tables (case values and case value attributes).  The case values are the names of the fields and the case value attributes are the values. I need to know the names of the fields to know what the values refer to so I have merged them.

 

Which gives me a table like this

case idcase attribute IDCase attibute name (database name)Field nameValue
13364NYP_HIH_001Type of referralCSE
13365NYP_HIH_002Ref assessmentHigh
13366NYP_HIH_003Date of referral1/11/2020
13367NYP_HIH_004Intial contact date05/11/2020

 

What I really want is the format below - classic excel format of col headers and data underneath, where the field name is the column header and its value underneath...i can delete the columns I dont need but the format is hard to achieve...

 

case idType of referralRef assessmentDate of referralInitial contact date
1CSEHigh01/11/202005/11/2020

 

I have lots of calcs to do between columns to form number of days taken, average days to do x, column x plus Column Y - Column Z etc etc etc and this classic excel format seems the best way to do it as all the data is then in one table as well (hence why I merged them at the beginning.

 

I have been trying the pivot table function in the Transform tab but end up with this

 

case idcase attribute idType of referralRef assessmentDate of referralInitial contact date
13364CSE000
133650High00
133660001/11/20200
1336700005/11/2020

 

But this doesnt work for calcutaing number of days between date of referral and initial contact date is showing as 0 for the case 1 as as no value.

Any advice on how best to do the pivot or to get the data in the format I require? Thanks in advance for any advice!

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Remove the 2 columns 

case attribute ID Case attibute name

before the Pivot.

Then Pivot on the Field Name, using Value as value.  Choose 'Don't aggregate' from advanced.

 

 

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

Remove the 2 columns 

case attribute ID Case attibute name

before the Pivot.

Then Pivot on the Field Name, using Value as value.  Choose 'Don't aggregate' from advanced.

 

 

Awesome!  This worked very well...I see what I should have done to complete it.  Thanks!  Have given kudos!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.