Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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?
Solved! Go to 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
)
)
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.
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
)
)
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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.