Forum Discussion
Slicer & Condtional Formating
if i have a measure that returns a total volume. could i have a conditional formatting with a rule depending on the slicer filter select at the time ?
Hi NewbieJono ,
You need to create a slicer table first.
For example,I made a sample table as below:
First create a slicer table as below:
slicer table = VALUES('Table'[category])Then create a measure as below:
Measure 2 = SWITCH( SELECTEDVALUE('slicer table'[category]), "a",1, "b",2, "c",3, BLANK(),4)Create a contional formatting as below:
And you will see:
For the sample .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
2 Replies
- amitchandakSuper User
NewbieJono , You can create color measure and use that in conditional formatting with field value option
example
Colour =
SWITCH(TRUE(),
'Table'[Date] < TODAY(), "red",
'Table'[Date] = TODAY(), "orange",
"green")Colour =
SWITCH(TRUE(),
max('Table'[Month Year]) = "Jan-2020", "red",
Max('Table'[Month Year]) < "Feb-2020", "orange",
//keep on adding
"green")Measure =
Switch(true(),
max(Table[Column]) = "R1" , "Red" ,
max(Table[Column]) = "R2" , "Green" ,
max(Table[Column]) = "R3" , "Pink "
)refer my video :
https://www.youtube.com/watch?v=RqBb5eBf_I4
or these blogs
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 - v-kelly-msftCommunity Support
Hi NewbieJono ,
You need to create a slicer table first.
For example,I made a sample table as below:
First create a slicer table as below:
slicer table = VALUES('Table'[category])Then create a measure as below:
Measure 2 = SWITCH( SELECTEDVALUE('slicer table'[category]), "a",1, "b",2, "c",3, BLANK(),4)Create a contional formatting as below:
And you will see:
For the sample .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!