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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
diogobraga2
Helper IV
Helper IV

Two values in 100% stacked bar, but show label for only one

How do I show label only for the value (utilization rate) being represented in light blue here?

 

2019-12-21_1915.png

1 ACCEPTED SOLUTION

Hi @diogobraga2,

In fact, you can also use Dax formula to create a table with unpivoted records. Please refer to the below blog to learn how to use 'UNION' and 'SELECTCOLUMNS' functions to create a calculated table with expanded records:

DAX Unpivot 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

7 REPLIES 7
v-shex-msft
Community Support
Community Support

HI @diogobraga2 ,

I'd like to suggest you do 'unpivoted columns'(query editor) on your value fields 'utilization rate' and 'not utilization rate', then you can modify your visual design to use 'attribute' on legends and 'value' on values.

Unpivot columns (Power Query) 
After these operations, you can simply use filters to control which attributes to display.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

By the way, the original dataset has only 'utilization rate' and that's the value that matters. I create the 'not utlization rate' by calculating 1-'utilization rate' since 100% is the maximum and I must show the utilzation out of 100%. Is there another way to show the 'utilzation rate' within a 100% bar axis to visualize this, without creating the 'not utilization rate' calculation therefore not needing to pivot to rows. Any ideas here? 

 

If creating the 'not utilization rate' calculated column (the way I am doing now) is the only way...then it sounds like I will have to create another table to pivot the columns to rows. 

 

 

Hi @diogobraga2,

In fact, you can also use Dax formula to create a table with unpivoted records. Please refer to the below blog to learn how to use 'UNION' and 'SELECTCOLUMNS' functions to create a calculated table with expanded records:

DAX Unpivot 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft can you please provide your feedback on this?

 

I got the following error message:

 

DAX comparison operations do not support comparing values of type Number with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

 

2019-12-28_1109.png

Hi @diogobraga2 ,

It seems like your utilization column stored numeric values and you are trying to compare text value with numbers.  For this scenario, I'd like to suggest you use blank() to replace "" to fix this issue.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

If possible please share a sample pbix file after removing sensitive information.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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