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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Beast
Frequent Visitor

Get count of rows from another table

Hi.., I have two tables where I need to get the count of rows based on condition matches.

ie., Get count of rows From Table 2 where Table 1 [Date] = Table 2[Date] and Table 1[Name] = Table 2[Name].

 

Need a Calculated Column, since I required to see this column when extracting the report.

 

Note: Since I have indirect relationship, I was not able to create a direct relationship between two tables.

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Beast ,

 

Based on your description, I have created a simple sampe:

vjianbolimsft_0-1675307317650.png

vjianbolimsft_1-1675307328451.png

Please try:

Column = COUNTROWS(FILTER('Table 2',[Date]=EARLIER(Table1[Date])&&[Name]=EARLIER(Table1[Name])))

Final output:

vjianbolimsft_2-1675307410734.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @Beast ,

 

Based on your description, I have created a simple sampe:

vjianbolimsft_0-1675307317650.png

vjianbolimsft_1-1675307328451.png

Please try:

Column = COUNTROWS(FILTER('Table 2',[Date]=EARLIER(Table1[Date])&&[Name]=EARLIER(Table1[Name])))

Final output:

vjianbolimsft_2-1675307410734.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

sudhav
Helper V
Helper V

you can use relatedtaable() / related()/userelationship DAX functions to get that...

i guess related() or Relatedtable() will be use in this scenario. once you can try

if it is having relation then you can use crossfilter() DAX function

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors