Forum Discussion
Add text value in bar chart instead of integer value
Need assitance for a bar chart in x axis instead of using a measure (used as count distinct) for status could we use text value to be displayed of Pass or Fail.
From
To
If this cannot be done in bar chart please let me know if any other visual could be used to achieve this.
unable to Attach PBIX file but below is tables to enter in power bi desktop.
| Application | Status |
| App 1 | Pass |
| App 10 | Pass |
| App 2 | Pass |
| App 3 | Fail |
| App 4 | Fail |
| App 5 | Fail |
| App 6 | Fail |
| App 7 | Pass |
| App 8 | Pass |
| App 9 | Pass |
Hey eng_123,
Looking at your images, I can see you want to display "Pass" and "Fail" text labels on your bars instead of the count values. This is definitely achievable in Power BI! Here are several approaches:
Method 1: Data Labels with Custom Text (Recommended)
- Select your bar chart and go to the Format pane
- Turn on Data labels
- In Data labels settings, change the Value dropdown from "Auto" to a field that contains your Pass/Fail text
- If you don't have a separate text field, create a calculated column or measure:
Status Text =
IF([Status] = 1, "Pass", "Fail")Method 2: Create a Status Text Column
If your current Status field is numeric (1/0), create a new calculated column:
Status Label =
SWITCH([Status],
1, "Pass",
0, "Fail",
"Unknown"
)Then use this new column in your data labels.
Method 3: Alternative Visuals
If the bar chart doesn't work perfectly, consider these alternatives:
- Stacked Bar Chart: Shows Pass/Fail segments clearly
- Table Visual: Simple and clear display of status by app
- Matrix Visual: Good for showing status across multiple dimensions
- Custom Visual: Consider "Bullet Chart" or "Linear Gauge" from AppSource
Method 4: Conditional Formatting
You can also:
- Keep the numeric values but use conditional formatting
- Set background colors (green for Pass, red for Fail)
- Use data bars with custom colors
Quick Fix for Your Current Chart
- Go to Format → Data labels → On
- Under Value, select your status field
- Under Display units, choose "None"
- Create a simple measure:
Status Display = IF(MAX([Status]) = 1, "Pass", "Fail")
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
2 Replies
- jaineshpMemorable Member
Hey eng_123,
Looking at your images, I can see you want to display "Pass" and "Fail" text labels on your bars instead of the count values. This is definitely achievable in Power BI! Here are several approaches:
Method 1: Data Labels with Custom Text (Recommended)
- Select your bar chart and go to the Format pane
- Turn on Data labels
- In Data labels settings, change the Value dropdown from "Auto" to a field that contains your Pass/Fail text
- If you don't have a separate text field, create a calculated column or measure:
Status Text =
IF([Status] = 1, "Pass", "Fail")Method 2: Create a Status Text Column
If your current Status field is numeric (1/0), create a new calculated column:
Status Label =
SWITCH([Status],
1, "Pass",
0, "Fail",
"Unknown"
)Then use this new column in your data labels.
Method 3: Alternative Visuals
If the bar chart doesn't work perfectly, consider these alternatives:
- Stacked Bar Chart: Shows Pass/Fail segments clearly
- Table Visual: Simple and clear display of status by app
- Matrix Visual: Good for showing status across multiple dimensions
- Custom Visual: Consider "Bullet Chart" or "Linear Gauge" from AppSource
Method 4: Conditional Formatting
You can also:
- Keep the numeric values but use conditional formatting
- Set background colors (green for Pass, red for Fail)
- Use data bars with custom colors
Quick Fix for Your Current Chart
- Go to Format → Data labels → On
- Under Value, select your status field
- Under Display units, choose "None"
- Create a simple measure:
Status Display = IF(MAX([Status]) = 1, "Pass", "Fail")
Fixed? ✓ Mark it • Share it • Help others!
Best Regards,
Jainesh Poojara | Power BI Developer
- eng_123Frequent Visitor
Thank you changed it and seems to work fine now