Forum Discussion
Color column conditions
- 5 years ago
Hi POWER_MI ,
You can create a table like :
Then use the following measure :
Measure 2 = CALCULATE(COUNTA(COLOR_FIELD_TO_ADD[Coulumn]),FILTER(COLOR_FIELD_TO_ADD,NOT(ISERROR(FIND(COLOR_FIELD_TO_ADD[Coulumn],MAX('Table'[ROWS]))))))Set background color for [measure2] by field [colorformat]:
For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EYCIfcnfrjNKoZ4x1HCEzPkB5QOxQggIjQVIQdbaS7p3cQ?e=tdyg3j
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
POWER_MI , When they are different measure each having color you can give static color to measure. Conditional formatting is needed when there is something dynamics .
Anyways as measures are returning number, you can not compare with the text
Try like
ColorFormat =
SWITCH (
TRUE (),
not(isblank(MAX ( 'Table'[Mesure_1_NBR_R1] ))), "Red",
not(isblank(MAX ( 'Table'[Mesure_2_NBR_R2] ))), "Green",
not(isblank(MAX ( 'Table'[Mesure_3_NBR_R3] ))), "Pink "
)
Also refer
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
hi amitchandak
Column "Measure_1_NBR_R2" in table "Table" could not be found and is not used in this expression.
Column "Measure_1_NBR_R1" in table "Table" could not be found and is not used in this expression.
Column "Measure_1_NBR_R3" in table "Table" could not be found and is not used in this expression.
- POWER_MI5 years agoPost Patron
Hi amitchandak
i send error when doing with swhich is not blanck.
to be clear
The begening condition is to color windows of values witch is the number of 'R1, nmber of R2 at differents step:
So the if condition will be
If Step 1 and status R1 the color of values "Number of R1 will be RED.
the number of R1 is calcultated with mesure
Mesure_1_NBR_R1
CALCULATE( COUNTA('tabla'[column]), 'table'[column] IN "R1"and same alos for R2.Also for examplefor step 1 and Step 6 the color of Number of values will be different so why it's mandatory to have conditions like swhich condition or if .. and not regulare or concrete values because the color of our windows number of values will be different on step 1 and step 6 or 7.For example Number of R1 is Red on step 1 but will be orange on Step 7 ( if step =7 number of R1 value windows will be orange)hope that it s clear thanks for help