Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
@ARomain , When Transport Site = New Orleans , then it not equal to any other value.
I doubt conditions are correct
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
94 | |
74 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |