cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Count ID once when it has many values in the table

I have a series of questions (34) that link to a set of 4 KPI's categories KPI 1, KPI 2, KPI 3 & KPI4.

Each KPI has more than 1 question related to it, which a client can answer yes to.

Each client can answer yes to multiple questions that link to the same KPI from the 34 questions asked.

I would like to count the number of clients that meet the KPI only once

 

What is the best way to set this out?

 

I have a table of all the questions with a yes by the questions they answered yes to. Ech client can anwer multpul questions but only the yes is brought into the table. 

I have a static table that references which question relates to the KPI indicated by a 1 in the table for each question relating to the KPI.

 

In the visual you can see the KPI 1 and the number of questions related to this.

 PBI3.PNG

The visual is just a table. Count of question ID is made by dropping in question ID twice and then changing one to count. KPI is from a static table and filtered to show the 1 next to the question ID

 

The help I need is, I have 8 clients who have answered one or more questions and I want to show a visual of KPI 1 and a count of 8 next to it

 

So the return that I want from my measure is 8 individual clients answered yes to a question that relates to the KPI 1

 

Any help would be greatly received, as I am new to DAX and still learning as I go along and this is a bit more complex to calculate

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Count ID once when it has many values in the table

Hi @Greg_Deckler 

 

Thanks for the tip!

 

In the end I went with 

 

KPI 1 Count = 
 CALCULATE(
     DISTINCTCOUNTNOBLANK( 'Support Needs'[Client Application ID] ),
     'Support Needs'[KPI 1] = 1
 )

 

This worked for me and gave the desired result.

 

 

View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: Count ID once when it has many values in the table

So in general you would use SUMMARIZE or you could use DISTINCT along with COUNTROWS or even DISTINCTCOUNT.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Helper I
Helper I

Re: Count ID once when it has many values in the table

Hi @Greg_Deckler 

 

Thanks for the tip!

 

In the end I went with 

 

KPI 1 Count = 
 CALCULATE(
     DISTINCTCOUNTNOBLANK( 'Support Needs'[Client Application ID] ),
     'Support Needs'[KPI 1] = 1
 )

 

This worked for me and gave the desired result.

 

 

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors