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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
sarath5140
Helper I
Helper I

Count Rows from another table based on date filter and group by column

Hi,

 

Can anyone help me in solving my below problem.

 

I have two tables TableA and TableB

 

TableA

 

CategoryIDDate
FactoryA12347/12/2018 0:00
FactoryA12457/13/2018 0:00
FactoryA121657/17/2018 0:00
FactoryB126787/24/2018 0:00
FactoryB126798/15/2018 0:00
FactoryB126808/21/2018 0:00
FactoryB126812/19/2019 0:00
FactoryC126828/6/2018 0:00
FactoryC126838/7/2018 0:00
FactoryC126849/13/2018 0:00
FactoryC1268510/30/2018 0:00
FactoryD126867/6/2018 0:00
FactoryD126877/19/2018 0:00
FactoryD126887/21/2018 0:00
FactoryD126898/3/2018 0:00
FactoryE126907/31/2018 0:00
FactoryE126918/3/2018 0:00
FactoryE126928/15/2018 0:00
FactoryE126938/18/2018 0:00
FactoryF126948/30/2018 0:00
FactoryF126959/18/2018 0:00
FactoryF1269611/1/2018 0:00
FactoryF1269711/22/2018 0:00

 

Table B

 

CategoryIdDate
FactroyA19397/13/2018 0:00
FactroyA19407/17/2018 0:00
FactroyA19417/28/2018 0:00
FactoryB19429/17/2018 0:00
FactoryB19439/21/2018 0:00
FactoryB194410/8/2018 0:00
FactoryB194510/16/2018 0:00
FactoryC19468/6/2018 0:00
FactoryC19478/7/2018 0:00
FactoryC19489/13/2018 0:00
FactoryC194910/30/2018 0:00
FactoryD19507/19/2018 0:00
FactoryD19517/21/2018 0:00
FactoryD19529/29/2018 0:00
FactoryD195310/11/2018 0:00
FactoryD195410/19/2018 0:00
FactoryE19557/31/2018 0:00
FactoryE19568/15/2018 0:00
FactoryE19578/18/2018 0:00
FactoryF19588/30/2018 0:00
FactoryF195911/1/2018 0:00
FactoryF196011/22/2018 0:00

 

Now, i would like to calculate the count of rows in tableB when Table A Category column matches with TableB Category column. So, my output should apppear like this

 

Output :-

 

CategoryTableACountTableBCount
FactoryA33
FactoryB44
FactoryC44
FactoryD45
FactoryE43
FactoryF43

 

I am able to acheive the TableB count by using the below dax

Output = calculate(countrows(tableB), Filter(TableB, TableB[Category] = TableA[Category])), but my output should change when I apply the date filter on TableA, my tableB count should also change based on the date slicer applied on TableA filter.

 

Note :- Both of my tables are not related to each other 

 

Appreciate your help!

 

Thanks

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my PBI file from here.

 

Hope this helps.


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my PBI file from here.

 

Hope this helps.


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

Thank you. Worked like a charm !

You are welcome.


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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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