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

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.

Reply
JoseAriel
Frequent Visitor

Count unique values

Hello,

 

I have a table which I hope to display along with a visualization Card indicating the total count of PastDue values in the therapy column which in this case would be 1. Any thoughts on what function I can use within a measure?

 

id_notherapynext_therapy
AOk2/28/2018
BOk12/6/2017
CPastDue6/8/2017
DDueSoon10/11/2017
EPastDue5/17/2017
FOk1/5/2018
1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

I'm wondering why it's 1, I would count it 2, because there are two unique id_no with the value "PastDue" ,but nevertheless.

This measure should return 1

CALCULATE(
DISTINCTCOUNT('yourtable'[therapy])
,'yourtable'[therapy] = "PastDue"
)

Hopefully this is what you are looking for

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi @JoseAriel,

 

Shouldn't the answer be 2 - there are 2 ID's with an entry of Past due?  Please clarify.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
TomMartens
Super User
Super User

Hey,

 

I'm wondering why it's 1, I would count it 2, because there are two unique id_no with the value "PastDue" ,but nevertheless.

This measure should return 1

CALCULATE(
DISTINCTCOUNT('yourtable'[therapy])
,'yourtable'[therapy] = "PastDue"
)

Hopefully this is what you are looking for

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Awesome!! You're right. Should have been 2. I used Count instead of distinct count. Seems to work. Thanks again. I am new to this. Deffinately enjoying the ride. Thanks again.

 

 

id_notherapynext_therapy
AOk2/28/2018
BOk12/6/2017
CPastDue 
DDueSoon10/11/2017
EPastDue5/17/2017
FOk1/5/2018
JoseAriel
Frequent Visitor

Hi,

I have a table with several rows (1 per client). I need to evaluate a column for PastDue Answers. That is, I need to know, of all the clients, how many have PastDue within the given column. I hope to use a visualization Card to display the result (total of answers with the word "PastDue").

Hi,

 

Same question posted here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

The result worked, however, it leads to another question.

 

When filtering by worker, some are all up-to-date therfore no "PastDue"s within the column. When that happens, PBI displays (Blank) on the visualizations Card. Any way to have it display 0 instead? Or even "All up to date"?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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