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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Count of unique occurrences with multiple criteria/exceptions

I need help finding the count of unique encounters for data similar to the example below. A unique encounter = unique ID at a unique location receiving a unique service on a unique date by a unique provider. I need to be able to filter and run unique encounter counts based on those variables, i.e. unique encounters at location VA vs CA, for service a vs b vs c, on [date], and by provider x vs y.

Thanks so much for any guidance!

 

IDLOCATIONSERVICESERVICE DATEPROVIDER
1VAa12/1/2021x
1VAa12/1/2021x
1VAa12/1/2021y
1VAb12/1/2021x
1VAa12/2/2021x
1VAb12/2/2021y
1VAc12/1/2021x
1VAc12/3/2021x
1VAc12/2/2021y
2CAa12/1/2021x
2CAa12/1/2001y
2CAc12/1/2021x
2CAc12/1/2021x
2CAb12/2/2021x
2CAb12/2/2021y
2CAa12/2/2021x
2CAb12/2/2021x
1 ACCEPTED SOLUTION

@Anonymous  so this works for you I guess

Measure3 = 
COUNTROWS (
    SUMMARIZE (
        'Table',
        'Table'[ID],
        'Table'[LOCATION],
        'Table'[PROVIDER],
        'Table'[SERVICE DATE],
        'Table'[SERVICE]
    )
)

 

smpa01_0-1638906570892.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

3 REPLIES 3
smpa01
Super User
Super User

@Anonymous  did you mean this

 

smpa01_0-1638904964273.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

I beleive that just counts the rows without any filters to identify unique encounters. For example, the first two rows should only count as 1 encounter because it's the same ID, at the same location, receiving the same service, on the same service date, by the same provider. The third row, however, is by a different provider to that should count as another unique encounter.

@Anonymous  so this works for you I guess

Measure3 = 
COUNTROWS (
    SUMMARIZE (
        'Table',
        'Table'[ID],
        'Table'[LOCATION],
        'Table'[PROVIDER],
        'Table'[SERVICE DATE],
        'Table'[SERVICE]
    )
)

 

smpa01_0-1638906570892.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.