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

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

Reply
Syndicate_Admin
Administrator
Administrator

Conditional formatting in function to subtotal

Good afternoon

I am working with a matrix that returns sales progressions from the previous year (EJ: current month / same month previous year).

I need to create a conditional format that highlights the values that are major/less than the subtotal. Attached image

gugui_0-1631816272064.png

In this case I obtain that the average progression of these 4 items for the month of January was 44.84%. I need to generate a dax function that allows me to conditionally format (green background color) to the values above 44.84%, in this case highlight from green to: Butcher. Highlight with red background the values below the subtotal: Warehouse / bazaar / cold cuts).

The function I use for progression is:

gugui_1-1631816446145.png

Thank you!

2 REPLIES 2
Anonymous
Not applicable

Hi @Syndicate_Admin,

AFAIK, you can use dax expression to find out the current row content level, but the conditional color format seems not works on the total level.

Clever Hierarchy Handling in DAX - SQLBI

Perhaps you can consider submitting an idea for this requirement.

Regards,
Xiaoin Sheng

lbendlin
Super User
Super User

Remember that in a matrix visual your values are calculated four times. For the individual cells, for the row total, the column total, and the grand total.

 

So in your case you need a measure that only calculates the column total, ignoring the DescripcionRubro field.

 

something like 

CALCULATE([Ventas Totales],SAMEPERIODLASTYEAR(Calendario[Date]),REMOVEFILTERS(table, table[DescripcionRubro]))

 

That will be your column total that you can compare your current value to and then from that you can drive the conditional formatting.

 

Please provide sanitized sample data in usable format (not as a picture - inserting it into a table would be good) if you like more assistance.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.