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

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.

Reply
AndresEsteban
Helper I
Helper I

Distinct count filtering by other column

Hello community I would need your help.

 

I have a table with the following records:
-Device: are different types of devices and sensors.
-Type of service: different types of services. Each device will belong to one of them
-Location: location where the service is deployed.

 

AndresEsteban_0-1654169835179.png

 

As can be seen in the attached example data, there can be more than one device of the same service in each location.

The problem I have is how to count the number of services I have in operation. For this, the logic is that even if there are different devices of the same service and therefore different rows with the same service for each location, that should only count as 1.
In the example, the expected result is as shown below:

AndresEsteban_1-1654169981059.png

 

Thank you in advance

 

1 ACCEPTED SOLUTION

@AndresEsteban my bad please create a measure as below:-

Measure =
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[Type of service],
        "sum", DISTINCTCOUNT ( 'Table'[Location] )
    ),
    [sum]
)

 

Samarth_18_0-1654177149328.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

6 REPLIES 6
Samarth_18
Community Champion
Community Champion

Hi @AndresEsteban ,

 

You can directly add "Type of service" column and "location" column with summerized as distinct count on the table visual.

output:-

Samarth_18_0-1654171245210.png

 

Refer the attached file.

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Perfect, it works!!

 

And another question, how could I calculate the total number of deployed services, in this case 7?

 

Thank you

@AndresEsteban Add Type of service column again with summerized as count. Refer the attached file.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

but the result should be 7 not 13. It would have to be done through a DAX measure.

@AndresEsteban my bad please create a measure as below:-

Measure =
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[Type of service],
        "sum", DISTINCTCOUNT ( 'Table'[Location] )
    ),
    [sum]
)

 

Samarth_18_0-1654177149328.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Thank so much, it's work perfetly!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.