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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

add a column to say how many rows of table B are related to each row of colum A

Hello All

I have 2 tables A and B with a one to many relationshio via a key called TOKEN

(unique values on A side, duplicates on B side)

I want to add a column in table A, telling how many rows of table B are related to each row of table A

this should be easy with the folowing formula

NbRelated = COUNTROWS (RELATEDTABLE(B))

But it returns me blank values

can someone help me out ?

thanks

 

4 REPLIES 4
parry2k
Super User
Super User

@Anonymous can you put a sample pbix file and share it using one drive/google drive. Also, can you make sure the relationship cross filter direction is single, not both?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thnak you for the advice

It works, with the following remarks :

I have some occurrences of TOKEN in table B which donot exist in table A, and I find them in the count 

I have occurrences of TOKEN in table A which donot exist in table B, I would expect a count = 0, which I donot find.

Can this be the explanation of the glitch ?

Thank you

Anonymous
Not applicable

f

parry2k
Super User
Super User

@Anonymous that should have worked, before you do this, in a table visual, put token from table a, and token column from table b and change the aggregation to count, do you get any counts against each token?

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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