Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi All, I have below dataset.
| Compnay Name | Spend | Fiscal Year | Department | Divison |
| Water | 5000 | 2022 | Sea | A |
| Rock | 10000 | 2022 | Forest | B |
| Salt | 3000 | 2021 | Sea | A |
| Rock | 1000 | 2022 | Forest | B |
| Water | 6000 | 2021 | Sea | A |
| Salt | 20000 | 2022 | Sea | A |
| Water | 50000 | 2021 | Sea | A |
| Water | 50000 | 2022 | Sea | A |
I have created below matrix in Power bi:
| Division | Sea Spend | Forest Spend | Top Company Name In spend | Spend Of Top Company |
| A | 134000 | 0 | Water | 50000 |
| B | 0 | 11000 | Rock | 10000 |
Now I want to do color formatting for Sea Spend and Forest Spend , that if the unique count of company count is below or equal to 2 in that case color the row as green , if more than 2 then red however the unqiue count is not in the matrix , it is availble in the dataset, also under top compnay name i want to show the top company name with highest spend and in Spend table how much they have spend.
@cyborgandy Maybe:
Color Flag Measure =
VAR __Table = DISTINCT('Table'[Company])
RETURN
SWITCH(TRUE(),
COUNTROWS(__Table)=2,1,
COUNTROWS(__Table)>2,2,
0
)
Use this measure in your conditional formatting based on Rules.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 6 | |
| 6 | |
| 5 |