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

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

Reply
Parihar1980
Helper II
Helper II

Count of rows of table 1 based on table 2 column condition in DAX expression (power bi)

I have 2 table A and B

table1

ID Name

1 A

2 B

3 C

4 D

 

table2

ID Name Date

1 A 01-02-2017

2 B 02-05-2017

3 c 02-05-2015

4 d 02-05-2014

expedted output : Count of the record which is matching in both table and Date shold be > 2016 

 

ANS : 2 

(E.g ID Name Date

1 A 01-02-2017

2 B 02-05-2017

Please let me know the DAX expression for this. 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Create a Flag with the following formula and filter Flag = 1 to get teh desired result.

 

Flag = IF(YEAR(Table2[Date]) > 2016 && RELATED(Table1[ID])= Table2[ID],1,0)

 

 

Thanks

Raj

View solution in original post

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Parihar1980,

 

Have you solved your problem?

 

If you have solved, always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Parihar1980,

 

Have you solved your problem?

 

If you have solved, always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Create a Flag with the following formula and filter Flag = 1 to get teh desired result.

 

Flag = IF(YEAR(Table2[Date]) > 2016 && RELATED(Table1[ID])= Table2[ID],1,0)

 

 

Thanks

Raj

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.