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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
dofrancis3
Helper III
Helper III

Count with filter based on service colomns

Dear colleagues !

Please could you help me with DAX Mesure that can allow me to have number of each service

 

dofrancis3_0-1729078787391.png

 

1 ACCEPTED SOLUTION

Dear @dharmendars007 

Thank you for this proposition; but the Distinct Count should be based on the ID column insteand of service.

So, below is the solution:

 

Number of Mental Health =

CALCULATE(
DISTINCTCOUNT('GBV_Mapping_CAR'[ID]),
'GBV_Mapping_CAR'[Service] = "Mental health")
  
Number of familly =
CALCULATE(
DISTINCTCOUNT('GBV_Mapping_CAR'[ID]),
'GBV_Mapping_CAR'[Service] = "Familly")
 
Number of Legal Assistance =
CALCULATE(
DISTINCTCOUNT('GBV_Mapping_CAR'[ID]),
'GBV_Mapping_CAR'[Service] = "Legal Assistance")

View solution in original post

2 REPLIES 2
dharmendars007
Super User
Super User

Hello @dofrancis3 , 

 

Please try the below measures..

 

Number of Legal Assistance =
CALCULATE(
COUNT('Dataset'[Service]),
'Dataset'[Service] = "Legal assistance")

 

Number of Mental Health =
CALCULATE(
COUNT('Dataset'[Service]),
'Dataset'[Service] = "Mental health")

 

Number of Family =
CALCULATE(
COUNT('Dataset'[Service]),
'Dataset'[Service] = "Family")

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Dear @dharmendars007 

Thank you for this proposition; but the Distinct Count should be based on the ID column insteand of service.

So, below is the solution:

 

Number of Mental Health =

CALCULATE(
DISTINCTCOUNT('GBV_Mapping_CAR'[ID]),
'GBV_Mapping_CAR'[Service] = "Mental health")
  
Number of familly =
CALCULATE(
DISTINCTCOUNT('GBV_Mapping_CAR'[ID]),
'GBV_Mapping_CAR'[Service] = "Familly")
 
Number of Legal Assistance =
CALCULATE(
DISTINCTCOUNT('GBV_Mapping_CAR'[ID]),
'GBV_Mapping_CAR'[Service] = "Legal Assistance")

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.