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

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
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.