Forum Discussion
Conditional Formatting per Row and Column
- Anonymous5 years ago
yasirm I would approach this by creating a measure which returns the hex code of the desired color, based on the values of "Category" in the current cell context (Month, Week).
Here's an example of what that format like look like:ConditionalFormatMeasure = SWITCH( TRUE(), SELECTEDVALUE('DataTable'[Category]) = "Category1", "#d7191c", SELECTEDVALUE('DataTable'[Category]) = "Category2", "#fdae61", SELECTEDVALUE('DataTable'[Category]) = "Category3","#abd9e9", DISTINCTCOUNT('DataTable'[Category]) > 1, "#2c7bb6" )After creating the measure you can use it to conditionally format the background color of the matrix values by using the "Format By: Field value" option.
Note you will need to add some measure/field to the "Values" of the Matrix to apply this formatting to - in my case I created an EmptyMeasure (EmptyMeasure = "").Below is an example of the result:
yasirm I would approach this by creating a measure which returns the hex code of the desired color, based on the values of "Category" in the current cell context (Month, Week).
Here's an example of what that format like look like:
ConditionalFormatMeasure =
SWITCH(
TRUE(),
SELECTEDVALUE('DataTable'[Category]) = "Category1", "#d7191c",
SELECTEDVALUE('DataTable'[Category]) = "Category2", "#fdae61",
SELECTEDVALUE('DataTable'[Category]) = "Category3","#abd9e9",
DISTINCTCOUNT('DataTable'[Category]) > 1, "#2c7bb6"
)After creating the measure you can use it to conditionally format the background color of the matrix values by using the "Format By: Field value" option.
Note you will need to add some measure/field to the "Values" of the Matrix to apply this formatting to - in my case I created an EmptyMeasure (EmptyMeasure = "").
Below is an example of the result: