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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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