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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 17 | |
| 16 | |
| 12 | |
| 8 | |
| 5 |