Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Column does not exist or does not have relationship

I have 3 tables, 2 reference table and 1 fact table.

 

My goal is to get the ITEM_COST in the Reference 2 into the Fact 1 using the link that connects to Reference 1 because Reference 2 and Fact 1 does not have common field.

 

 

But i am having error "The column 'Reference 2'[ITEM_COST]' either doesn't exist or doesn't have a relationship to any table available in the current context."

 

Column = IF(RELATED(Reference 1[ORG] = "ABC"),RELATED(Reference 2[ITEM_COST])*RELATED(Reference 1[QUANTITY_RATE])
 
How do i make it work?
 
 

2 Replies

  • Anonymous don't take me wrong, it is a very poor model, first, related wouldn't work if you have many to many relationships. You have to prepare/transform your data to create one to many relationships between your fact and dimension table and then it should be easier.

     

    Follow us on LinkedIn

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    I am not very clear about the data in your table and the results you want to output. Based on my understanding, you can create a virtual table as follows:

    1.original data.

    2.create a new table.

    Fact = GENERATE(FILTER('Reference1',[ORG]="ABC"),FILTER('Reference 2',[ITEM_COST]="ABC"))

    3.then create a coulmn.

    Column = [QUANTITY_RATE]*[item]

    The final output is shown below:

    If it is not correct, can you share pbix or screenshots whitout any sesentive information and the results you want to output?

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.