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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Conditional Formatting in Total and SubTotal

Hey guys,

 

I needed help here on this conditional formatting on this matrix table. I needed this dax measure to give me the best 3 results in green and the worst 3 results in red.

 

What is happening is that you are giving only the best value and the worst value in the Total column, however in the row below the sub total the values do not correspond to the best value in green and the worst in red.

 

I also wanted a way to add on the measure the best 3 lines in green and the worst 3 lines in red (in column Total and Sub Total), I tried to put it with the TOPN but it is not working to apply it correctly, can anyone help?

 

The measure I am using is as follows:

 

 

Cores = 
VAR MaxAmount = CALCULATE(MAXX(VALUES(Folha1[Técnico]),[Pago]),ALL(Folha1[Técnico]))
VAR MinAmount = CALCULATE(MINX(VALUES(Folha1[Técnico]),[Pago]),ALL(Folha1[Técnico]))
VAR LineAmonut = [Pago]
RETURN 
SWITCH (
    TRUE(),
    LineAmonut = MaxAmount, "GREEN",
    LineAmonut = MinAmount, "RED"
    )

 

Thanks!

1 REPLY 1
lbendlin
Super User
Super User

You may want to look into using RANKX to define the top 3 and bottom 3 items.

 

Please provide sample data in usable format and show the expected outcome.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors