How to Format a Column Chart in Power BI: Conditional Color with fx, Axis Range and Data Labels
A column chart of revenue by category is useful. A column chart where every category above target is green and every one below is red, with labels in the same colours, is useful at a glance. In this chapter you format the axes, set a Y-axis range the right way (full numbers, starting at 0), then reuse the idea from the card chapter: one text measure that returns a colour, plugged into the columns and the data labels through fx.
What you'll learn in this chapter
- Clustered and stacked with two values, and when to use which
- X-axis and Y-axis formatting; axis title
- Y-axis Range: full numbers, minimum 0
- A target color measure with [total revenue]
- Columns › Color › fx › Field value
- Data label colour with the same measure
Practice file: blinkit-sales-2023-2025.csv (1,702 order lines).
Made-up data: fictional Blinkit-style sales, for practice only. Amounts are in ₹ and dates are DD-MM-YYYY.
1. The problem
The manager's target is ₹50,000 per category over the three years. The chart should show at a glance which categories made it, with readable axes and no misleading scale.
2. The idea in simple words
Every formatting option with an fx button can take its value from a measure. A measure that returns "Green" or "Red" can colour each column, because the measure is calculated once per column, for that column's category:
target color = IF([total revenue] > 50000, "Green", "Red")
Classroom line
Wherever you see fx, you can use measures.
Class मधलं वाक्य
जिथे जिथे तुम्हाला fx दिसतोय, त्या सगळ्या जागी तुम्ही measures वापरू शकता.
Classroom line – हिंदी
"Jahan jahan pe aapko fx dikh raha hai, us sabhi jagah aap measures use kar sakte hain."
3. The data
| Category | Revenue (₹) | Sales (units) | Above ₹50,000? |
|---|---|---|---|
| Atta, Rice, Oil & Dals | 1,01,540 | 383 | Yes |
| Dairy, Bread & Eggs | 55,512 | 770 | Yes |
| Home, Kitchen & Pet Supplies | 52,843 | 158 | Yes |
| Snacks & Munchies | 44,655 | 793 | No |
| Fruits & Vegetables | 39,107 | 629 | No |
| Cold Drinks & Juices | 37,186 | 456 | No |
4. Step by step
Two values, then one
- Clustered column chart: X-axis category, Y-axis revenue and sales. Two columns per category, side by side.
- Revenue (₹ thousands) and units (hundreds) do not share a scale. Remove sales from Y-axis and drag it into Tooltips instead: hover to see units.
Axes
- Format visual › X-axis › Values: font Segoe UI Bold, size 14, colour black.
- Y-axis › Range: Minimum
0, Maximum120000. Type full numbers: 120000, not 120 for "120K". - Y-axis › Title › On.
The colour measure
- New measure:
target color = IF([total revenue] > 50000, "Green", "Red"). - Columns › Color › fx › Format style Field value › target color › OK. Three columns turn green, three red.
Data labels
- Data labels › On. Values › Color › fx › Field value › target color. The labels take the same colours.
Figure 1. Format steps from axes to fx colours (illustration).
Classroom line
Whichever visual type you pick, the data converts to it automatically.
Class मधलं वाक्य
तुम्ही कुठलाही visual select करा, data जसा आहे तसा तो आपोआप convert होतो.
Classroom line – हिंदी
"Aap select karte waqt koi bhi select karo, jaisa data hai waisa wo apne aap convert ho jayega."
Classroom line
Whichever category you hover over, the sum of sales shows there too.
Class मधलं वाक्य
ज्या category वर तुम्ही mouse न्याल, तिथे sum of sales पण दिसतो.
Classroom line – हिंदी
"Jis category pe aap mouse leke jaoge, wahan pe sum of sales bhi add ho gaya."
5. Your result should look like this
Figure 2. Columns above ₹50,000 in green, below in red, with labels in the same colours (illustration).
- Green: Atta, Rice, Oil & Dals (1,01,540), Dairy, Bread & Eggs (55,512), Home, Kitchen & Pet Supplies (52,843).
- Red: Snacks & Munchies (44,655), Fruits & Vegetables (39,107), Cold Drinks & Juices (37,186).
- Y-axis from 0 to 1,20,000 with a title; hover shows sales.
6. What happened
- target color is calculated once per column, in that column's filter context (its category), so each column gets its own colour.
- The data labels use the same measure, so colours always match.
- The Range values are raw numbers; the "K" you see on the axis is only display formatting.
Classroom line
When you need to compare two things, take a clustered column chart or a clustered bar chart.
Class मधलं वाक्य
दोन गोष्टी compare करायच्या असतील, तर clustered column chart किंवा clustered bar chart घ्या.
Classroom line – हिंदी
"Jab aapko do cheezein compare karna ho, to clustered column chart ya clustered bar chart lenge."
7. Explore further
- Keep 0 for columns. A column's height is its value; starting the axis at 30,000 makes 37,186 look tiny next to 55,512. Use a raised minimum mainly for line charts.
- Hex colours.
IF([total revenue] > 50000, "#1E8E3E", "#D93025")gives exact shades. - Stack only parts of a whole. Revenue split by payment can be stacked; revenue and sales together cannot.
- Same measure, more places. The title colour, background and data labels all take fx. The card version is in How to Change Card Color and Text Dynamically in Power BI (Above or Below Target with DAX IF); the main course lesson The Format Pane covers every setting.
Classroom line
Okay, try this much.
Class मधलं वाक्य
"ठीक आहे, करा बघू एवढं."
ठीक आहे, एवढं करून बघा.
Classroom line
Okay, try this much.
8. Common mistakes
| Wrong result | Reason | Fix |
|---|---|---|
| Range set, axis looks empty | Typed 120 for 120K | Type 120000 |
| Small differences look huge | Minimum above 0 | Minimum 0 for columns |
| All columns one colour | Static colour, not fx | Color › fx › Field value |
| Measure greyed out in fx | Measure returns a number | Return "Green"/"Red" text |
| Units flattened next to ₹ | Revenue and sales on one Y-axis | Sales in Tooltips |
Ravindra Bagale's Tip
Write the target once, in a measure such as category target = 50000, and use IF([total revenue] > [category target], …). When the target changes, you edit one number.
Ravindra Bagale's Tip – मराठी
Target एकदाच, category target = 50000 सारख्या measure मध्ये लिहा, आणि IF([total revenue] > [category target], …) वापरा. Target बदलला की तुम्ही एकच number बदलता.
Ravindra Bagale's Tip – हिंदी
Target एक ही बार, category target = 50000 जैसे measure में लिखें, और IF([total revenue] > [category target], …) इस्तेमाल करें. Target बदले तो आप सिर्फ एक number बदलते हैं.
9. Practise on your own
Practice task
Using blinkit-sales-2023-2025.csv:
- Change the target to ₹45,000. How many categories are green?
- Make a column chart of revenue by state with target color at ₹50,000. Which states are green?
- What should the Y-axis maximum be for the state chart, in full numbers, to fit Maharashtra?
- Colour the data labels with the same measure. Which label colour does Gujarat get?
Show solution
- 3: Snacks & Munchies (44,655) is still just below.
- Maharashtra (1,22,142), Karnataka (75,009) and Telangana (52,876).
- Above 1,22,142, e.g. 130000.
- Red (₹41,446).
10. Think like a professional
- Business view. Colour by rule turns a chart into a status board.
- Honest axes. Bars start at 0.
- One scale per axis. Put secondary numbers in tooltips.
- One measure, many uses. The same target color can colour columns, labels and titles.
Interview questions
- How do you colour each column by a condition? Columns › Color › fx › Field value with a measure that returns a colour.
- Why should a column axis start at 0? Column height represents the value; a raised start exaggerates differences.
- What do you type in Y-axis Range for 1,20,000? 120000.
- How do you show revenue and sales on one column chart? They are different units: keep revenue on the Y-axis and put sales in the tooltip (or a separate visual).
Recap
In short
- Format X and Y axes; turn the Y title on.
- Range in full numbers; minimum 0 for columns.
target color = IF([total revenue] > 50000, "Green", "Red").- Columns › Color › fx › Field value › target color.
- Data labels › Color › fx › the same measure.
Revision card