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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Conditional Format all columns up to a certain column based on values

I'd like to conditional format the background color of a cell based on whether or not a column further down has valid data.

 

The data given is as follows:

TeamPhaseSubphaseValue
Team 11A1
Team 11B1
Team 11C1
Team 12A1
Team 21A0
Team 21B0
Team 21C0
Team 22A1
Team 31A1
Team 31B1
Team 31C0
Team 32A1
Team 33A1

 

This is what I would like the result to be. For Team 1, all of Phase 1 (A, B, and C) has valid data. They are ok to start on Phase 2A.

Team 2 skipped Phase 1 entirely (1A, 1B, 1C have 0 entered in the cell) and started on Phase 2A. This isn't allowed, so the Phase 1 cells with 0s in them should be red.

Team 3 did 1A and 1B, but skipped 1C and started on Phase 2A and 3A. It is ok for them to start on 3A without completing all of Phase 2, but it is not ok for them to start on 2A without completing all of Phase 1. Therefore, only 1C is red.

clueless_poster_0-1727349136364.png

 

3 REPLIES 3
Anonymous
Not applicable

Hi,bhanu_gautam .
Hello,@Anonymous .I am glad to help you.
Like this?

vjtianmsft_0-1727424711331.png

 

I noticed that in the original data you provided you had already processed the data for the conditions you described: they were correctly labeled as 0, so I marked the cells that were not empty and had a value equal to 0.
Is your original data also the same as the test data you provided: the data is marked as 0 beforehand, if so, you only need to mark the cells that have a value of 0.

I created three dimension tables based on the fields

 

Phase_ = VALUES('Table'[Phase])


Subphase = VALUES('Table'[Subphase])


Team_ = VALUES('Table'[Team])

 

vjtianmsft_1-1727424778198.pngvjtianmsft_2-1727424785913.png

After placing them in the matrix, it relies on relational filtering to show null values (data that doesn't exist by itself)

vjtianmsft_3-1727424809244.png

Relying on the filtering of the matrix itself, filtering out cells with value = 0, as you mentioned in your description, indicates a step that should not be skipped (which is actually skipped)

If your actual data and your test data is not consistent with the definition of the criteria, please tell later and promptly correct my misunderstanding.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@Anonymous , Try using below method

 

Create a New Column for Validation
Open your Power BI Desktop and load your data.
Go to the "Data" view.
Create a new column by clicking on "New Column" in the Modeling tab.
Use the following DAX formula to create a validation column:


Validation =
VAR CurrentTeam = 'Table'[Team]
VAR CurrentPhase = 'Table'[Phase]
VAR CurrentSubphase = 'Table'[Subphase]
VAR CurrentValue = 'Table'[Value]
VAR PreviousPhases =
FILTER(
'Table',
'Table'[Team] = CurrentTeam &&

 

 

Apply Conditional Formatting
Go to the "Report" view.
Select the table visual where you want to apply the conditional formatting.
Click on the down arrow next to the column you want to format (e.g., Value).
Select "Conditional formatting" > "Background color".
In the "Background color" window, select "Field value" under "Format by".
Choose the Validation column created 
Set the color for "Invalid" to red and "Valid" to no color or a different color as needed.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Anonymous
Not applicable

Is there more to the FILTER? What is the condition?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.