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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ARomain
Helper I
Helper I

New Measure with multiple does not contain filters

I am trying to create a new measure within Power BI Desktop.  I want it to distinct count all Product ID's that are only sent to certain locations and not to others

 

1. Transport Site = New Orleans

2. Transport Site is not New York

3. Transport Site is not Los Angeles

 

I would assume the below would work, but it does not

 

Calculate(DistinctCount(Sheet1[CaseID],

Filter(Sheet1, 

'Sheet1'[TransportSite] = "New Orleans"),

Filter(Sheet1,

'Sheet1'[TransportSite] <> "New York"

|| 'Sheet1'[TransportSite]<> "Los Angeles"))

 

However, when I do this and it doesn't work. Any advice?

 

 

1 ACCEPTED SOLUTION

Hi, @ARomain 

Create a new measure to count the number of location in each ProductID:

 

Count of location = 
CALCULATE (
    COUNT ( 'Table'[Location] ),
    ALLEXCEPT ( 'Table', 'Table'[Product ID] )
)

 

Then change the second filter condition in your original measure as below:

 

Count = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Product ID] ),
    FILTER (
        'Table',
        'Table'[Location] = "New Orleans"
            && [Count of location] = 1
    )
)

 

39.png

 

 

 

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@ARomain , When Transport Site = New Orleans , then it not equal to any other value.

I doubt conditions are  correct

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have data that looks like this

 

Product ID                           Location

1001                                    New Orleans

1001                                    New York

1002                                    New Orleans

1002                                    Los Angeles

1003                                    New York

1004                                    New Orleans

 

I am trying to find the item that ONLY went to New Orleans. In this case, it is just 1 (1004)

 

If I set my filter to Location=New Orleans, it brings me back a value of 3 (1001, 1002, 1004)

 

 

Hi, @ARomain 

Create a new measure to count the number of location in each ProductID:

 

Count of location = 
CALCULATE (
    COUNT ( 'Table'[Location] ),
    ALLEXCEPT ( 'Table', 'Table'[Product ID] )
)

 

Then change the second filter condition in your original measure as below:

 

Count = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Product ID] ),
    FILTER (
        'Table',
        'Table'[Location] = "New Orleans"
            && [Count of location] = 1
    )
)

 

39.png

 

 

 

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.