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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AnSchmi
Helper II
Helper II

Distinctcount records in fact table not exist in dimension table.

dear communitiy,
I have in my dimension table orders not matching orders in fact table and I would like to show them in a table.
The Relationship is by Order.No. 
I'm trying to calculate the distinct number of orders in fact table not matching the orders in dimension table. 
No of orders with missing order detail records = 

CALCULATE(
    [No of Work Order Header],
    FILTER(
        'd Tbl Items Production Header',
        'd Tbl Items Production Header'[Work.Order.No] not exist in fact table 'f Tbl Items Production Details'[Work.Order.No] 
    )
    )
Can anyone help to understand the logic. 
Thanks a lot 
Andreas
2 REPLIES 2
johnt75
Super User
Super User

Try

No of orders with missing order detail records =
CALCULATE (
    [No of Work Order Header],
    FILTER (
        'd Tbl Items Production Header',
        ISBLANK ( RELATED ( 'f Tbl Items Production Details'[Work.Order.No] ) )
    )
)

Dear johnt75, 
unfortunately this is not working due to following error
The column 'f_Tbl_Items_Production_Details[Work.Order.No]' either doesn't exist or doesn't have a relationship to any table available in the current context. 
There is a link to a very limited extract of my model.
https://fileshare.ssl.iscar.com/data/public/8afb8a 
Would you pls. have a look again on it.
Thanks a lot
Andreas


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.