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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
michellepace
Resolver III
Resolver III

Lookup values in tables based on columns which do not define the relationship

Hi there,

 

I have these two tables with a 1-1 relationship defined on AccNumber. What I need to do is populate the MainAccDescrip column.

-------------------------------------------------------

AllAccounts

AccNumber | AccDescrip

 

pnlAccounts

AccNumber | MainAccNumber | MainAccDescrip |

-------------------------------------------------------

 

What I need to do is populate the MainAccDescrip column. That is, get the 'AccDescrip' value from the AllAccounts table using the value in MainAccNumber. If I had to write pseudo 'matrix' code, it would look like this:

MainAccDescrip = AllAccounts[MainAccNumber].AccDescrip

 

Can anyone shed some light on how I do this please?

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Assuming all entries in the AccNumber column of AllAccounts Table are unique and there are no blanks in this column, build a relationship from the AccNumber of PnlAccounts Table to the AccNumber column of the AllAccounts Table.  In the PnlAccounts Table, write this calculated column formula

=RELATED(AllAccounts[AccDescrip])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for trying but my question is perhaps unclear. I need to use MainAccNumber as the lookup in the AccNumber column in the top table. What you have suggested won't work for me. Thanks though for replying 🙂

You have managed to completely confuse me.  Share the link from where i can download your PBI file and clearly show the expected result there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I need to create the two columns MainGlAccDesc and SubGLAccDesc. AccNumber is a unique field in the AllAccounts table, pnlAccounts table is a subset of the AllAccounts table.

 

PowerBi file here:  https://michellepace.com/?dir=PowerBi

 

pic.png

Hi,

There is no AllAccounts Table in the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Check your other post.  Please do not post the same question more than once.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashsih, thank you for your replies. This is not at all the same question. Please take a read in detail. Sorry I'm just a completely confused newbie here struggling. A lot. 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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