Forum Discussion
conditional formatting doesn't work
Giada_Togliatti , refer if these can help
Conditional formatting
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
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
- Giada_Togliatti6 years agoPost Patron
amitchandak , Tahreem24 , az38 I've applied the same conditional formatting I need (a conditional formatting based on another measure) and it works, why if I tried to use the same in a table like the attached on it doesn't work?
In attached an example: if I add a dimension like product name and I have more rows it works
If I remove product name is again without color
This is my question, I hope I've explained well my problem in real case
- az386 years agoCommunity Champion
it depends on your measure statements
- Giada_Togliatti6 years agoPost Patron
amitchandak the measure used for conditional formatting that work with more rows but not with one row is this:
example = Switch( true(),V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite superiore'[Limite superiore 1]), "red",V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite inferiore'[Limite inferiore 1]) && V_REPORT_PPM_RISORSE[measure1]<selectedvalue('Limite superiore'[Limite superiore 1]), "light green","yellow")where limite superiore and limite inferiore are two parameter
- amitchandak6 years agoSuper User
Giada_Togliatti ,this is because the range will change, In fact, for one value those ranges might not apply. What are the conditions you are using?
Try to create a color measure with help from isinscope and isfilter and use that with "Field" option
example
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)refer for isinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
Use of color measure
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- Giada_Togliatti6 years agoPost Patron
amitchandak I can't use FIRSTNONBLANK with a measure, in the formula I used a measure inside another measure
example = Switch( true(),
V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite superiore'[Limite superiore 1]), "red",
V_REPORT_PPM_RISORSE[measure1]>selectedvalue('Limite inferiore'[Limite inferiore 1]) &&
V_REPORT_PPM_RISORSE[measure1]<selectedvalue('Limite superiore'[Limite superiore 1]), "light green","yellow")and, do you know if it's possible to apply conditional formatting for total in a table?