Hello,
i need to apply conditional formatting in matrix visual in powerBI (top 3 value in each rows).
I Tried top n in dax but it did not worked for me .
ex- below snapshot for refrence
Thanks in advance.
Dhruti
Solved! Go to Solution.
Here's a measure expression that shows one way to do it. Just use this measure as the Field for conditional formatting for the measure in the matrix visual. Note that if you have a sort-by column on your month, you'll need to include that in the measure too.
Top3MonthColor =
VAR thismonth =
MIN ( 'Date'[Month] )
VAR top3Mos =
TOPN ( 3, ALLSELECTED ( 'Date'[Month] ), [Total Qty], DESC )
RETURN
IF ( thismonth IN top3Mos, "Light Green" )
Pat
Here's a measure expression that shows one way to do it. Just use this measure as the Field for conditional formatting for the measure in the matrix visual. Note that if you have a sort-by column on your month, you'll need to include that in the measure too.
Top3MonthColor =
VAR thismonth =
MIN ( 'Date'[Month] )
VAR top3Mos =
TOPN ( 3, ALLSELECTED ( 'Date'[Month] ), [Total Qty], DESC )
RETURN
IF ( thismonth IN top3Mos, "Light Green" )
Pat
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
User | Count |
---|---|
107 | |
74 | |
66 | |
50 | |
49 |
User | Count |
---|---|
163 | |
85 | |
76 | |
68 | |
67 |