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
Anonymous
Not applicable

Fomating based on values from different tables

Hi, I have a table with the serial numbers produced of a given part, date of production and equipment ID used to produce. In a different table, I have the equipment ID and its corresponding modification date. The two tables are related by a many to 1 relationship respectively on the equipment ID.

I have a matrix visual displaying the equipment in the rows, the dates in the columns and the count(distinct) of the serial numbers produced in the values field. 

I would like to know how to Condition format the values (count(distinct) of serial numbers), so the background color is changed only for the ones produced after the modification date of the equipment. So to distinguish visually the before modification and after modification production.

Thank you in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

thank you, Tom.

I worked it out like this:

1-created a new column in Recoater[...] table with:

 

Pump Cleaned = if(Recoat[Recoat Date]>=RELATED('Recoaters to verify'[Date pump cleaned]);"yes";"no")

 

Recoat[...] and 'Recoaters to verify'[...] are two different tables linked by Recoater ID.

 

2-created a slightly different measure than the one you suggested. I used:

Measure = 
VAR thresholdmeasure = SELECTEDVALUE(Recoat[Pump Cleaned])
RETURN
SWITCH(TRUE();
thresholdmeasure = "yes";1;
thresholdmeasure = "no";0)

3-Used conditional formatting, formatted by color and based on this new measure.

It works like a charm.

 

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

unfortunately I do not fully understand your requirement, for this reason please consider to provide a pbix file that contains sample data rerpresenting your data model, upload the pbix to onedrive or dropbox and share the link.

Nevertheless,

create a measure that returns the color you want to use as background color. And then use the measure from the conditional formattiong dialog on the measure that you are using inside your matrix visual. A measure might look like this:

<nameofthemeasure> =
var thresholdmeasure = 1 --<- replace one with your calculation
return
if(thresholdmeasure = 1 , "green" , BLANK()) --assuming you want green as background color

Hopefully this provides you with some ideas to solve your problem.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

thank you, Tom.

I worked it out like this:

1-created a new column in Recoater[...] table with:

 

Pump Cleaned = if(Recoat[Recoat Date]>=RELATED('Recoaters to verify'[Date pump cleaned]);"yes";"no")

 

Recoat[...] and 'Recoaters to verify'[...] are two different tables linked by Recoater ID.

 

2-created a slightly different measure than the one you suggested. I used:

Measure = 
VAR thresholdmeasure = SELECTEDVALUE(Recoat[Pump Cleaned])
RETURN
SWITCH(TRUE();
thresholdmeasure = "yes";1;
thresholdmeasure = "no";0)

3-Used conditional formatting, formatted by color and based on this new measure.

It works like a charm.

 

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.