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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jonvjj
New Member

How to create a bar chart and hierarchy for drill down from data set in post

Hi, 

 

I am trying to create a horizontal bar chart that I can drill into. I have the following data set in Excel.

 

Company Details 1Company Details 2Company Details 3Company Details 4Company Details 5Company Details 6Speed Sub category 1Speed Sub category 2Speed Sub category 3Balance Sub Category 1Balance Sub Category 2Balance Sub Category 3Balance Sub Category 4Balance Sub Category 5Balance Sub Category 6Comment
Test companyTest locationTest nameTest positionTest numberTest name115515523Test response
Test company 1Test location 1Test name 1Test position 1Test number 1Test name 1555555555Test response 1

 

Initially on the bar chart I want to show the average of the Speed and average of Balance scores as two separate bars. I then want to be able to drill down into both bars separatley. For example I want to be able to double click on Speed see the three individual bars relating to each three Speed Sub Categories.

 

When I have tried to do this in Power BI it doesn't let me create a hierarchy. I tried adding two new columns in my data to show the average for Speed and Balance but still couldnt create a hierarchy.

 

Someone suggested I unpivot the columns to change the layout of the data, so I ended up with all questions in the same column and the scores to the right, as per below.

 

Company Details 2Company Details 3Company Details 4Company Details 5Company Details 6AttributeValueComment
Test locationTest nameTest positionTest numberTest nameSpeed Sub category 11Test response
Test locationTest nameTest positionTest numberTest nameSpeed Sub category 21Test response
Test locationTest nameTest positionTest numberTest nameSpeed Sub category 35Test response
Test locationTest nameTest positionTest numberTest nameBalance Sub Category 15Test response
Test locationTest nameTest positionTest numberTest nameBalance Sub Category 21Test response
Test locationTest nameTest positionTest numberTest nameBalance Sub Category 35Test response
Test locationTest nameTest positionTest numberTest nameBalance Sub Category 45Test response
Test locationTest nameTest positionTest numberTest nameBalance Sub Category 52Test response
Test locationTest nameTest positionTest numberTest nameBalance Sub Category 63Test response
Test location 1Test name 1Test position 1Test number 1Test name 1Speed Sub category 15Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Speed Sub category 25Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Speed Sub category 35Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Balance Sub Category 15Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Balance Sub Category 25Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Balance Sub Category 35Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Balance Sub Category 45Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Balance Sub Category 55Test response 1
Test location 1Test name 1Test position 1Test number 1Test name 1Balance Sub Category 65Test response 1

 

As the Sub Categories were all in one column I couldnt see how I could create the hierarchy to be able to drill down.

 

Does anyone have any ideas how I can fix this?

 

Thanks!

2 REPLIES 2
v-cherch-msft
Employee
Employee

Hi @jonvjj 

It seems you may create a column like below to separate the attribute column.

Column = IF(CONTAINSSTRING('Table'[Attribute],"Speed"),"Speed","Balance")

a1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-cherch-msft ,

 

Thanks for the reply. I tried putting this in after adding a Custom Column. When I try your recommendation I am shown the below error 'Token Literal expected'. My data has also changed from Speed to Brief and Balance to Conduct of Exercise.

 

Capture 1.PNG

 

When I click on Show Error, the ' before the Table1 is highlighted. Table 1 is the name of my data.

 

Capture.PNG

 

Are you able to help on this?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.