Forum Discussion
Add text value in bar chart instead of integer value
- 1 year ago
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
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