Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
michellem0771
Helper I
Helper I

Conditional Formatting Help

Hello,

 

I have a report that shows revenue for this year and revenue for the same period last year.

I want to dynamically highlight the clients that fell off the TopN from the prior year and highlight those clients that are new to the TopN list this year. 

 

I was successful in getting the measure correct, except when the resulting rank is less than the TopN.  

The measure to identify the records is:

 

T_Top25_S1 = IF(
                ([TopN Client Ranking by Client SPLY] > [TopN Value] || ISBLANK([TopN Client Ranking by Client SPLY]))
                    && [TopN Client Ranking by Client] <= [TopN Value]
                        ,"New",
             IF(
                [TopN Client Ranking by Client SPLY] <= [TopN Value]
                    && ([TopN Client Ranking by Client] > [TopN Value] || ISBLANK([TopN Client Ranking by Client]))
                        ,"Fall Off",
             IF(
                [TopN Client Ranking by Client SPLY] <= [TopN Value]
                    && [TopN Client Ranking by Client] <= [TopN Value]
                        ,"Remain"
                        )
                )
        )
 
With the conditional formatting measure here:
Top25 CF =
SWITCH([T_Top25_S1],"New","#11c214","Fall Off","#e6003b","Remain","#000000")
 
My TopN filter is between 0 and 100 in increments of 5.
When selecting Top 25 with no other filters, the data is correct. (It is always correct if the resulting data is greater than the Top N.)
michellem0771_0-1703092520676.png

When I filter by a specific group, and keep the Top N at 25 or greater and the results are less than the Top N, the conditional formatting is not working.

 michellem0771_1-1703092610897.png

 

I see that my measure doesn't account for those records where the Rank is less than the Top N, but everything I try isn't working.

 

Can anyone help me with this please?

 

Thank you!

 
1 ACCEPTED SOLUTION
michellem0771
Helper I
Helper I

I was able to correct this issue by coding the rankx to exclude any null values for current year / prior year revenue.

Once I did that, the logic on my query above corrected and the conditional formatting reacted as expected.

 

View solution in original post

1 REPLY 1
michellem0771
Helper I
Helper I

I was able to correct this issue by coding the rankx to exclude any null values for current year / prior year revenue.

Once I did that, the logic on my query above corrected and the conditional formatting reacted as expected.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.