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
manike
Frequent Visitor

How to set color condition from 2 table

I would like to set the color condition from 2 table which have already set the relationship betweem them. However, I have tried some times but didn't work. (it seems only set the condition from 1 table only)

Here is my idea on color condition from 2 table.

Table1[Value] = 'A' and Table2[Value2]= 'abc'  then 'Red'

Table1[Value] = 'B' and Table2[Value2]= 'cdf'  then 'Yellow'

Table1[Value] = 'C' and Table2[Value2]= 'cdf'  then 'Green'

 

I tried the below but keep fail.

color = SWITCH(
TRUE()
,Table1[Value] = 'A' and Table2[Value2]= 'abc'  < 1, "#f44242"
,Table1[Value] = 'B' and Table2[Value2]= 'cdf', "#f4f142"
,Table1[Value] = 'C' and Table2[Value2]= 'cdf', "#5ff442",
"#f44242"
)
 
Would you all please help? Thanks!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@manike , If you creating a new column then you have brought column from one table to another

 

say you want bring to Table 1 and table 1 is on many side in 1-M relation

then you can use

related(Table2[Value2])

 

otherwise try

Maxx(relatedtable(Table2),Table2[Value2])  //you can use minx, countx or sumx as per need

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@manike , If you creating a new column then you have brought column from one table to another

 

say you want bring to Table 1 and table 1 is on many side in 1-M relation

then you can use

related(Table2[Value2])

 

otherwise try

Maxx(relatedtable(Table2),Table2[Value2])  //you can use minx, countx or sumx as per need

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.