Forum Discussion
Conditional Formatting/Coloring Values
- Anonymous4 years ago
I'm sort of confused a little on this. So do I create a DAX Expression using both the 15 Staff and 5 Staff?
SWITCH(TRUE()
[15 Staff] < #, "Red",
[5 Staff] > #. "Green",
ELSE "Yellow"
Hi Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create a measure as below:
Conditional formatting =
VAR _seltime =
SELECTEDVALUE ( 'Time'[Time] )
VAR _15staff =
CALCULATE (
MAX ( 'Time'[15 Staff] ),
FILTER ( 'Time', 'Time'[Time] = _seltime )
)
VAR _5staff =
CALCULATE (
MAX ( 'Time'[5 Staff] ),
FILTER ( 'Time', 'Time'[Time] = _seltime )
)
RETURN
SWITCH (
TRUE,
[Count of Students] < _15staff, "Red",
[Count of Students] > _5staff, "Green",
[Count of Students] >= [Count of Students]
&& [Count of Students] <= _5staff, "Yellow"
)
2. Apply conditional formatting for the Values field
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards