# The column XXXX either doesn't exist or doesn't have a relationship to any table available in the current context.



## Badrul (Jun 30, 2015)

I did a search on this error message on this forum but am surprised to find no one has provided a clear or any answer from what I can see.

It's very simple. I have two tables that are related together using an numeric ID field. All good.
Table A is the "one" side of the one to many relationship and Table B is the many side.

Table B contains one or more invoice date(s) that table A is after.

So I think simple, add a calculated column:
=CALCULATE(Min(Invoice[InvoiceDate]))

However that returns blank for some rows that ought to have values and incorrect dates for others.

So then I tried:
=RELATED(Invoice[InvoiceDate])

But this gives:
The column Invoice[InvoiceDate] either doesn't exist or doesn't have a relationship to any table available in the current context.

Anyone know the answer to this?


----------



## Matt Allington (Jul 1, 2015)

What are you trying to do?  What do you mean "table B contains one or more invoice dates that table A is after"?
What are you expecting the calculate formula will give you, which of the 2 tables are you placing it in?   You mention a table called "Invoice" but you said your tables were Table A and Table B. So it is hard to work out what you are trying to do, and why. 

Assuming TableA is on the one side, and it is called TableA. And assuming you are adding a new column in TableB, and assuming there is a column in TableA called [InvoiceDate], then you can write a calc column in TableB as follows
=related(tableA[InvoiceDate]


----------

