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
erezb
Frequent Visitor

stacked bar lables visibilty

a combination of 2 deseasesa combination of 2 deseases

Hello

 

I've made a staked bar graph showing number of  cases in each medical disease.

I've limited this to paitens with up to a 5 diseases .

I have also have a filter from which  I can choose a number from 1 to 5, reffering to the number of disease in a each combination.

However when I go to the cases with more than one desease (2-5) the x axis lables are not clear.  the picture I have attached  is for 2 disease in a combination however it becomes worse when i choose a highr number.

If it were excel I could have made the disease names written one after the other in the same cell(ctrl+enter)' and that would fix the problem, however here the only soloution came into my mind is to split the text (each desease separated by a + sign) and build a new string with concatenate,  but it didn't work out. I managed to split the string but not build a new correct one.

 

if there was a way that the lables could be like that:

 

disease a+ (line feed+

disease b+ (line feed)+

disease c

....

up to 5 diseases.

 

Does someone have an idea how to implement this?

 

Thanks in advance

Erez

 

 

 

1 ACCEPTED SOLUTION

Hi @erezb,

 

The easiest solution could be using spaces instead of "+". You can check out it in this file. Remember to change the width of the category.

stacked_bar_lables_visibilty2

 

 

 

Best Regards,

Dale

 

 

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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi Erez,

 

Did you use the built-in visuals? Or R visual? It seems fair in my test. How did you combine the labels? Please vote on idea here

stacked_bar_lables_visibilty

 

Best Regards,

Dale

 

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

Thanks for your reply v-jiascu-msft.

I've used the same slicer as you did.In your graph x-lables seems as I am tring to achieve. My data is located in an sql table I've imported into power Bi.No R is involved here.

One of the fields in this table is the combination fields.The disease combination is concatenated with the '+' character , I.e for an id that  has 3 diseases it will be - disease1+disease2+disease3, up to idd holding 5 diseases. The concatenation is done in sql.

Each row in this table corresponds to id fiels also located in the table, One row for each Id and of course as mentioned the combination fields and together with fields  (cost, etc).

 

id      disease's combination disease ,                 number of disease ,cost and so on.....

1       disease1+disease2+disease3                        3                          1000

2       disease1+disease2                                        2                           1300

2       disease1+disease2+disease3+disease3        4                           2,000

 

 Is there a solution? Maybe to split the combination and build it again inside Power-Bi.

 

Thanks again

Erez

 

 

 

 

Hi @erezb,

 

The easiest solution could be using spaces instead of "+". You can check out it in this file. Remember to change the width of the category.

stacked_bar_lables_visibilty2

 

 

 

Best Regards,

Dale

 

 

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

Thanks v-jiascu-msft

 

It works fine now. 

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.