cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
atpbi10
Frequent Visitor

Creating new column based on values from values from two other tables

I have three tables with this relationship:

halp.PNG

I want to create a new column/measure that I can use to filter my visuals later, which basically takes two columns, one from `Main` table and one from `MappingUtil`. 

So basically I want to filter out rows where the corresponding columns from `Main` and `MappingUtil` are equal. I tried using this to create new column in `Sheet1` table:

 

 

CorrectFloor = 
IF (
    RELATED ('Main'[Assigned Floor]) = RELATED ( 'MappingUtil'[Floor] ),
    "Correct",
    "Incorrect"
)

 

 

 

However Im getting error:

 

The column 'Main[Assigned Floor]' either doesn't exist or doesn't have a relationship to any table available in the current context

 

 

 

But as you can see in the model above it they are both linked to `Sheet1` table. What am I doing wrong?

4 REPLIES 4
Eyelyn9
Community Support
Community Support

Hi @atpbi10 ,

 

Could you please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business after removing sensitive data?😀

 

Best Regards,
Eyelyn Qin

lbendlin
Super User
Super User

that is incorrect. You can influence the connection type and the search direction.  Also check your source data for irregularities (duplicates in columns where you expected unique values)

lbendlin
Super User
Super User

You may want to read up on some of the fundamentals of Power BI, especially the application of star schemas. Please rethink the relationships between your tables.

atpbi10
Frequent Visitor

Hey thanks for the reply. I had no choice in how those relationships were applied, powerbi locked them in and does not allow to change.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.