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
harshadrokade
Post Partisan
Post Partisan

Showing Text on visual instead of number

I want to create a bar visual with text shown on it instead of number.

 

I have below data. When someone selects Team A on slicer, the bar visual should show small bar with data label as Low & not 20. Similarly, when B team is selected on slicer, the visual should show little bigger bar with data label as Medium & not 60. Can you pls help. 

 

Refer belwo data & sample visual I gave below-

 

TeamScoreFormulas
A20Low
B

60

Medium
C80High

 

harshadrokade_0-1623754375399.pngharshadrokade_1-1623754400348.png

 

2 ACCEPTED SOLUTIONS
v-jingzhang
Community Support
Community Support

Hi @harshadrokade 

 

The closest effect I realized with a clustered bar chart is below, though not beautiful and need to be improved. 😅

061703.jpg

The main points are:

1. Add a new column to the table to be used to determine the length of the bar.

Level = SWITCH('Table'[Formulas],"Low",1,"Medium",2,"High",3)

061704.jpg

 

2. Create a measure for the conditional title of this bar chart

Title = SELECTEDVALUE('Table'[Formulas],"Please select a Team")
 
3. For the bar chart, set the X axis in Linear Scale type, Start from 0 and End to 3. Then turn off X axis. This step is important. If you turn off X axis without setting up the Start and End values, the length of the bar will be changed automatically when you select different items in the slicer.
061705.jpg
 
For other minor settings, please download attached pbix file for details. Hope this helps.

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

Hi @harshadrokade 

 

I still take the old score data for example as the settings are similar. In your case, drag the Data label column into Details field of a pie chart. Then format the Detail labels and select Category for Label style.

061801.jpg

Based on my test, Details field doesn't accept a measure, so you need to create a column in the table rather than a measure.

Data label column =
SWITCH (
    TRUE (),
    'Scoredata'[Actual score] >= 0.2
        && 'Scoredata'[Actual score] <= 0.3, "Very Bad",
    'Scoredata'[Actual score] >= 0.4
        && 'Scoredata'[Actual score] <= 0.5, "Bad",
    'Scoredata'[Actual score] >= 0.6
        && 'Scoredata'[Actual score] <= 0.7, "Good",
    'Scoredata'[Actual score] >= 0.9
        && 'Scoredata'[Actual score] <= 1, "Very Good"
)

 

Regards,

Jing

View solution in original post

6 REPLIES 6
v-jingzhang
Community Support
Community Support

Hi @harshadrokade 

 

The closest effect I realized with a clustered bar chart is below, though not beautiful and need to be improved. 😅

061703.jpg

The main points are:

1. Add a new column to the table to be used to determine the length of the bar.

Level = SWITCH('Table'[Formulas],"Low",1,"Medium",2,"High",3)

061704.jpg

 

2. Create a measure for the conditional title of this bar chart

Title = SELECTEDVALUE('Table'[Formulas],"Please select a Team")
 
3. For the bar chart, set the X axis in Linear Scale type, Start from 0 and End to 3. Then turn off X axis. This step is important. If you turn off X axis without setting up the Start and End values, the length of the bar will be changed automatically when you select different items in the slicer.
061705.jpg
 
For other minor settings, please download attached pbix file for details. Hope this helps.

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

@v-jingzhang Hello Sir,

 

I have similar use case where

I have a use case where I have below data. I want to create a pie chart with values in column 'Actual score' but the data labels should show values as mentioned in 'Data label' column. So for Team A, it should show value on pie as Very Bad instead of 25%. Pls help sir/mam to create a measure that will consider the below mentioned conditions & show the Data lael in text format instead of score value.

 

Table name- Scoredata

Team    Actual score                     Data label- Condition for deciding Data label

A          25%                                  If score is between 20-30%, Very Bad

B          45%                                  If score is between 40-50%, Bad             

C          67%                                  If score is between 60-70%, Good                

D          95%                                  If score is between 90-100%, Very Good           

Hi @harshadrokade 

 

I still take the old score data for example as the settings are similar. In your case, drag the Data label column into Details field of a pie chart. Then format the Detail labels and select Category for Label style.

061801.jpg

Based on my test, Details field doesn't accept a measure, so you need to create a column in the table rather than a measure.

Data label column =
SWITCH (
    TRUE (),
    'Scoredata'[Actual score] >= 0.2
        && 'Scoredata'[Actual score] <= 0.3, "Very Bad",
    'Scoredata'[Actual score] >= 0.4
        && 'Scoredata'[Actual score] <= 0.5, "Bad",
    'Scoredata'[Actual score] >= 0.6
        && 'Scoredata'[Actual score] <= 0.7, "Good",
    'Scoredata'[Actual score] >= 0.9
        && 'Scoredata'[Actual score] <= 1, "Very Good"
)

 

Regards,

Jing

Thanks a lot sir. This is closer to the solution.

amitchandak
Super User
Super User

@harshadrokade , One of the ideas that came to me, is that having three image URLs added to this table, like what you shown and display max of that

And How to do that sir. 🙂 I am very new to the Power bi sir. Can you suggest a measure that can help me to show text on a bar chart instead of values?

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.