Hello!
I'm looking to use a single visual (possibly KPI?) to display a traffic light system representing overall status. So for example:
Inventory | Status |
Laptop | Pass |
Keyboard | Pass |
Watch | Fail |
Based on the table above, the visual should display Red for example, since the column contains "Fail".
Inventory | Status |
Laptop | Pass |
Keyboard | Pass |
Based on the second table above, where the user has filtered to exclude the item "watch", the visual should now display Green, since all statuses displayed are "Pass".
Inventory | Status |
Mouse | Untested |
Chair | Pass |
And finally, based on the table above, the visual should display yellow since there is an instance of Untested in the column.
Could someone please help me out with this? Any pointers would be really appreciated, thanks so much in advance!
Solved! Go to Solution.
Or you can even do this and just diplay the measure on a card!
Colour =
IF (
CALCULATE (
COUNT ( 'InventoryTable'[Status] ),
FILTER ( 'InventoryTable', 'InventoryTable'[Status] = "Fail" )
) > 0,
"🔴",
IF (
CALCULATE (
COUNT ( 'InventoryTable'[Status] ),
FILTER ( 'InventoryTable', 'InventoryTable'[Status] = "Untested" )
) > 0,
"🟡",
"🟢"
)
)
😀
Or you can even do this and just diplay the measure on a card!
Colour =
IF (
CALCULATE (
COUNT ( 'InventoryTable'[Status] ),
FILTER ( 'InventoryTable', 'InventoryTable'[Status] = "Fail" )
) > 0,
"🔴",
IF (
CALCULATE (
COUNT ( 'InventoryTable'[Status] ),
FILTER ( 'InventoryTable', 'InventoryTable'[Status] = "Untested" )
) > 0,
"🟡",
"🟢"
)
)
😀
Awesome, this worked excellently. Thanks very much for your help!
If you create a new measure sort of like this:
Colour =
IF (
CALCULATE (
COUNT ( 'InventoryTable'[Status] ),
FILTER ( 'InventoryTable', 'InventoryTable'[Status] = "Fail" )
) > 0,
"Red",
IF (
CALCULATE (
COUNT ( 'InventoryTable'[Status] ),
FILTER ( 'InventoryTable', 'InventoryTable'[Status] = "Untested" )
) > 0,
"Yellow",
"Green"
)
)
you can then use the measure value directly in any visual as its colour, backgound colour, border etc etc.
You can use conditional formatting for this sort of thing.
Add a column to the table to represent the appropriate colour for each Status
, for example, Pass = Green then set the conditional formatting up.
Here's the help page https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting#color...
User | Count |
---|---|
135 | |
62 | |
57 | |
55 | |
46 |
User | Count |
---|---|
130 | |
61 | |
58 | |
56 | |
50 |