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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Count If In A Related Table

Hello,

I have a measure in Table-A that I would like to deuplicate, but only if the Unique ID is contained in Table-B, with the relationship established between the Unique ID fileds. 

So, If I have 11 records as a result of the current Measure in Table-A

How do I get this same result, but only for the 9 records with matching Unique ID in Table-B?

 

Here is the measure for Table-A:

ReStartCount = CALCULATE(StartDetail[start count], StartDetail[startdate] >= StartDetail[DateBeginFootprint], StartDetail[starttype] = "Resubscribed Start")

 

2 REPLIES 2
Stachu
Community Champion
Community Champion

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1Column2
A1
B2.5

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Sure thing.

In this subset, Table A has 11 rows.   In Table B (whole dataset not copied) there are 9 rows with matching Unique IDs.  I want to count just those 9 rows. 

Thanks for the help.

 

Table A: 

Unique IDstarttypestartdateDateBeginFootprint
40431973Resubscribed Start12-Aug-228/1/2022 0:00
73209141Resubscribed Start2-Oct-228/1/2022 0:00
73287965Resubscribed Start9-Oct-228/1/2022 0:00
10406350Resubscribed Start4-Sep-228/1/2022 0:00
73312306Resubscribed Start30-Oct-228/1/2022 0:00
73333199Resubscribed Start23-Oct-228/1/2022 0:00
50563861Resubscribed Start18-Sep-228/1/2022 0:00
60803325Resubscribed Start14-Aug-228/1/2022 0:00
10994140Resubscribed Start14-Aug-228/1/2022 0:00
30972428Resubscribed Start9-Oct-228/1/2022 0:00
40219278Resubscribed Start9-Oct-228/1/2022 0:00

 

Table B:

zipcodeUnique IDDateBeginFootprint
30253AJC60398998Monday, August 01, 2022
30253AJC73280714Monday, August 01, 2022
30253AJC10175238Monday, August 01, 2022
30253AJC70403227Monday, August 01, 2022
30253AJC60614045Monday, August 01, 2022
30253AJC50642527Monday, August 01, 2022
30253AJC30576515Monday, August 01, 2022
30253AJC60848377Monday, August 01, 2022

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.