Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
54 | |
38 | |
31 |
User | Count |
---|---|
78 | |
64 | |
64 | |
49 | |
45 |