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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Kavya_2001
New Member

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

1 ACCEPTED SOLUTION
Abhilash_P
Responsive Resident
Responsive Resident

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

View solution in original post

1 REPLY 1
Abhilash_P
Responsive Resident
Responsive Resident

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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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