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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PbiCeo
Helper II
Helper II

How to get value from a calculated column on a different table

I created a calculated column on TableA:

Years = IF('TableA'[Div] = "AA1", 1, DATEDIFF('TableA'[StarDate], TODAY(), Year))

 

A I want to get the above value on TableB:

YearsRef = 'TableA'[Years]

 

But got an error like that:

A single value for column 'xxxxx' in table 'xxxxxx' cannot be determined.
This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

Any advice please to solve that?
Thanks in advance,
Vadi

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

It depends on the relationship between Tables A and B.  If Table A is on the 1 side, you can use RELATED('TableA'[Years]).  If reversed, you can use RELATEDTABLE() and an aggregation function like MIN() to get to your result.  You can also use LOOKUPVALUE(), in many situation or if no relationship at all.

 

You should also consider doing what you need with measures instead of calculated columns.  Much of what is done in columns should be done in measures.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi Pat,

 

Thank you for your advice.

There is no relationship between two tables and I can make a relationship many to many only.

Years column has values on TableA like the following:
1

1

8

I want to get these same values on TableB.
Thank you,

Vadi

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.