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
thomasreick
Resolver I
Resolver I

How to get the distinctcount of matching entries in the related table

Hi there,

I am actually stuck on this.

fact and dim-Tabel are related using the field productcode.

Because the dim is not in a DWH but an external file there is a mistach in the count of productcodes.

The dim holds many more productcodes (~ 5.000) than the fact is providing.

NoOfFactProductCodes = DISTINCTCOUNT(fact[Produkcode)] =650

How do I generate a measure to count the related productcodes that are matching within my dim (DISTINCCOUNT of INNER JOINed) Fields.

Thanks for input.

Thomas

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try 

Num matched product codes =
CALCULATE (
    DISTINCTCOUNT ( fact[product code] ),
    NOT ISBLANK ( dim[product code] )
)

View solution in original post

2 REPLIES 2
thomasreick
Resolver I
Resolver I

Hello johnT75,

Perfect, thank you very much. This is working and gets me the desired value.

Thomas

johnt75
Super User
Super User

Try 

Num matched product codes =
CALCULATE (
    DISTINCTCOUNT ( fact[product code] ),
    NOT ISBLANK ( dim[product code] )
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors