Forum Discussion

Kavya_2001's avatar
Kavya_2001
Advocate I
1 year ago
Solved

Count records from Direct query table excluding records which are available in import mode table

Hello Everyone,
Greetings,

I have below two tables
1. Fact_stores table with has columns Storeid, Storelocation, Zipcode - (Direct Mode )

2. Exclude_stores table which has Storeid column - (Import Mode)

Need to create a measure which calculates the count of storeid's from Fact_stores excluding storeid from Exclude_stores table

  • Hi Kavya_2001 ,
    You can create a measue as below

    CALCULATE (
    COUNT(Fact_stores[Storeid]),
        KEEPFILTERS (
            NOT 'Fact_stores'[Storeid] IN VALUES ('Exclude_stores'[Storeid])  
        )
    )

    Let me know if these measure works
    Thanks

1 Reply

  • Hi Kavya_2001 ,
    You can create a measue as below

    CALCULATE (
    COUNT(Fact_stores[Storeid]),
        KEEPFILTERS (
            NOT 'Fact_stores'[Storeid] IN VALUES ('Exclude_stores'[Storeid])  
        )
    )

    Let me know if these measure works
    Thanks