cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
harshadrokade
Helper III
Helper III

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.

View solution in original post

@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

View solution in original post

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

amitchandak
Super User IV
Super User IV

@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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors