cancel
Showing results for 
Search instead for 
Did you mean: 
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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors