Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |