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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
techhelp
New Member

Conditional formatting rows based on blank values in the grand total column with matrix visuals

I have a matrix visual and I turned on the grand total column setting. I want to create a conditional formatting rule that will highlight all rows where the grand total column value is blank. 

2 ACCEPTED SOLUTIONS
Jaywant-Thorat
Super User
Super User

This is a very common Matrix + Grand Total + Conditional Formatting challenge in Power BI. Let’s solve it cleanly and the right DAX way.
Step 1 – Create a helper measure to detect blank Grand Total
Assume your main measure is: [Total Sales]
Create a new measure:
Row Highlight Flag =
VAR GrandTotalValue =
CALCULATE(
[Total Sales],
REMOVEFILTERS( 'Date' ) -- replace with your column used in Columns of matrix
)
RETURN
IF(
ISBLANK( GrandTotalValue ),
1,
0
)

 

Why this works?

  • REMOVEFILTERS() forces DAX to calculate Grand Total for that row
  • If it’s BLANK(), the row qualifies for formatting

Step 2 – Apply Conditional Formatting

  1. Select your Matrix visual
  2. Go to Values → Conditional formatting
  3. Choose:
    • Background color (or Font color)
  4. Select:
    • Format by → Rules
    • Based on field → Row Highlight Flag
  5. Rule setup:
    • If value is 1
    • Apply your highlight color (e.g., light red or yellow)

This will highlight the entire row, not just one cell.

 

Common Mistakes to Avoid
Using   ISBLANK([Total Sales])   directly
>> That only checks cell-level, not Grand Total

Formatting based on the value column itself
>> Won’t work for row-level logic

 

=================================================================
Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Jaywant Thorat | MCT | Data Analytics Coach
LinkedIn: https://www.linkedin.com/in/jaywantthorat/
Join #MissionPowerBIBharat = https://shorturl.at/5ViW9
#MissionPowerBIBharat
LIVE with Jaywant Thorat from 10 Jan 2026
8 Days | 8 Sessions | 1 hr daily | 100% Free

View solution in original post

Amar_Kumar
Super User
Super User

 

This is doable, but there’s one important limitation: Power BI does not let you directly reference the Grand Total column in conditional formatting. You have to re-create the same logic in a measure and use that measure for formatting.


Step 1: Create a measure that returns the grand total value :-

Grand Total Value = CALCULATE([YourValueMeasure],REMOVEFILTERS( 'YourColumnField' ))

 

Replace 'YourColumnField' with the field used in Columns of the matrix.

Step 2: Create a flag measure for formatting :-

Highlight Blank Grand Total =
IF(ISBLANK( [Grand Total Value] ),1,0)

Step 3: Apply conditional formatting

  1. Select the matrix

  2. Go to Format - Conditional formatting

  3. Choose Background color (or Font color)

  4. Format by: Rules (or Field value)

  5. Base it on: Highlight Blank Grand Total

  6. Rule:

    • If value = 1 - set highlight color

    • Else - no color

View solution in original post

8 REPLIES 8
v-pgoloju
Community Support
Community Support

Hi @techhelp,

 

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

v-pgoloju
Community Support
Community Support

Hi @techhelp,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @cengizhanarslan , @Jaywant-Thorat , @Amar_Kumar and @Kedar_Pande  for prompt and helpful responses.

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

Kedar_Pande
Super User
Super User

@techhelp 

 

Measure for Grand Total check:

Row Has Data = 
IF(
ISINSCOPE(YourRowField1) && ISINSCOPE(YourRowField2),
NOT(ISBLANK([YourMeasure])),
NOT(ISBLANK([YourMeasure]))
)

Conditional formatting:

Values field → Conditional formatting → Background color

Format by: Field value → Select [Row Has Data]

Apply to: Values and totals

Rule: = TRUE → Red background

 

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

Amar_Kumar
Super User
Super User

 

This is doable, but there’s one important limitation: Power BI does not let you directly reference the Grand Total column in conditional formatting. You have to re-create the same logic in a measure and use that measure for formatting.


Step 1: Create a measure that returns the grand total value :-

Grand Total Value = CALCULATE([YourValueMeasure],REMOVEFILTERS( 'YourColumnField' ))

 

Replace 'YourColumnField' with the field used in Columns of the matrix.

Step 2: Create a flag measure for formatting :-

Highlight Blank Grand Total =
IF(ISBLANK( [Grand Total Value] ),1,0)

Step 3: Apply conditional formatting

  1. Select the matrix

  2. Go to Format - Conditional formatting

  3. Choose Background color (or Font color)

  4. Format by: Rules (or Field value)

  5. Base it on: Highlight Blank Grand Total

  6. Rule:

    • If value = 1 - set highlight color

    • Else - no color

Jaywant-Thorat
Super User
Super User

This is a very common Matrix + Grand Total + Conditional Formatting challenge in Power BI. Let’s solve it cleanly and the right DAX way.
Step 1 – Create a helper measure to detect blank Grand Total
Assume your main measure is: [Total Sales]
Create a new measure:
Row Highlight Flag =
VAR GrandTotalValue =
CALCULATE(
[Total Sales],
REMOVEFILTERS( 'Date' ) -- replace with your column used in Columns of matrix
)
RETURN
IF(
ISBLANK( GrandTotalValue ),
1,
0
)

 

Why this works?

  • REMOVEFILTERS() forces DAX to calculate Grand Total for that row
  • If it’s BLANK(), the row qualifies for formatting

Step 2 – Apply Conditional Formatting

  1. Select your Matrix visual
  2. Go to Values → Conditional formatting
  3. Choose:
    • Background color (or Font color)
  4. Select:
    • Format by → Rules
    • Based on field → Row Highlight Flag
  5. Rule setup:
    • If value is 1
    • Apply your highlight color (e.g., light red or yellow)

This will highlight the entire row, not just one cell.

 

Common Mistakes to Avoid
Using   ISBLANK([Total Sales])   directly
>> That only checks cell-level, not Grand Total

Formatting based on the value column itself
>> Won’t work for row-level logic

 

=================================================================
Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Jaywant Thorat | MCT | Data Analytics Coach
LinkedIn: https://www.linkedin.com/in/jaywantthorat/
Join #MissionPowerBIBharat = https://shorturl.at/5ViW9
#MissionPowerBIBharat
LIVE with Jaywant Thorat from 10 Jan 2026
8 Days | 8 Sessions | 1 hr daily | 100% Free

cengizhanarslan
Super User
Super User

1) Assume this setup

  • Matrix Rows: e.g. Dim[RowName]

  • Matrix Columns: e.g. Dim[Month]

  • Matrix Values: [Your Measure]

  • Column Grand Total is ON

 

2) Create a helper measure to detect “blank grand total”

Is Blank Grand Total =
VAR GrandTotalValue =
    CALCULATE (
        [Your Measure],
        REMOVEFILTERS ( 'Dim'[RpwName] )
    )
RETURN
IF ( ISBLANK ( GrandTotalValue ), 1, 0 )
 
3) Create a color (or flag) measure
Row Highlight Color =
IF ( [Is Blank Grand Total] = 1, "#FFF2CC", BLANK() )

 

4) Apply conditional formatting

  1. Select the Matrix

  2. Values → Conditional formatting

  3. Choose:

    • Background color (or Font color)

  4. Format by: Field value

  5. Based on field: Row Highlight Color

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
dk_dk
Super User
Super User

Hi @techhelp 

You can create a measure yourself that replicates the grand total column (Can't help with the DAX since I do not know what is in your matrix) and use this measure to drive the conditional formatting.
You will need to set up conditional formatting for each column in your matrix separately, as it is not possible to format entire rows at once.

Let me know if you have any questions.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





sevenhills
Super User
Super User

  

Check: https://learn.microsoft.com/en-gb/power-bi/create-reports/desktop-conditional-table-formatting for d...

 

You can do simple as 

 sevenhills_0-1768328345742.png

But if you want only for grand totals and not intermediate totals, 
Create a measure as
Grand Total Color =
IF(
ISFILTERED(YourTable[YourColumn]) && ISINSCOPE(YourTable[YourColumn]) && MIN(YourTable[YourColumn]) = MAX(YourTable[YourColumn]), // Detects grand total
"Red", // Color for grand total
"White" // Default color
)

  • Select your Matrix visual.
  • Go to the Visualizations pane, find the measure you want to format (e.g., Sum of Sales), click the down arrow, and select Conditional formatting > Background color (or Font color, etc.).
  • In the advanced controls dialog, set Format style to "Field value".
  • For "What field should we base this on?", select the color measure you just created (e.g., Grand Total Color).
  • Crucially, in the "Apply to" dropdown, select "Values and Totals" to ensure the formatting applies to both regular cells and grand totals. 



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.