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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
CG20
Regular Visitor

Need help in calculated column

Hi All,

I'm struggling with the calculations below is the data i.e. is Table1 & Table2, they have Many(Table1) to One(Table2) relationship.

CG20_1-1716200511378.png

 

 

I want that if ID & Country from Table1 has a matching record with the same ID & Country from Table2 then give me the Status column value for that matching record which would be TRUE/FALSE which I have deriverd.

 

I want help from you guys that for Non matching values(N) from Table1 with respect to Table2, Non matching Countries from Table1 should refer to the ALL value from Country column from Table2 & in the output we should get the Status column value of the ALL value of the Country column.

Inshort I want the values from STATUS column when ID&COUNTRY is matching we want STATUS of that particular ID&COUNTRY & for Nonmatching values it should refer to the Country = ALL & should return the Status value of the ALL value to all the nonmatching values of that particular ID

 

I'm trying to create a calculated column as: 

 

Check1 = IF(AND(Postgres[chain_id] = RELATED(Pheonix[ID]), Postgres[country] = RELATED(Pheonix[COUNTRY])), "Y", "N")
Check2 = IF(AND(Postgres[chain_id] = RELATED(Pheonix[ID]), Postgres[Check1] = "Y"), RELATED(Pheonix[Status]), "N")
 
Thanks for reading & helping me advance, eagerly waiting for the replies.

 

 

 

2 REPLIES 2
Arul
Super User
Super User

@CG20 ,

Which column serves as the relationship key between the tables? Neither the "country" column nor the "ID" column appears to satisfy a one-to-many relationship between the tables.





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

Proud to be a Super User!


LinkedIn


CG20
Regular Visitor

Hi Arul,

 

I had created a calculated column which contains concatenation of id&country in both the tables. When you create that you will see a Many(Table1) to One(Table2) relationship.

 

If you still have any doubts do reply on this post.

 

Thanks & Regards

CG20

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.