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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
investigatorjon
Regular Visitor

Quick Measure for distinct count total

Hello everyone,

 

Very new to Power BI desktop and PBI in general and wanted to get some insight on a simple problem that I have in regards to creating a quick measure that accurately counts the total of a filtered distinct measure.

 

For reference here is the problem I am encountering:

report (ID)outcome (distinct count)
000111-20243
000112-20243
TOTAL4

 

As indicated in the table above, Power Bi is giving me a distinct count of the different types of outcomes (which in my dataset IS actually 4 so this makes sense).

 

However, I simply want a total count measure of the the sum of the outcomes that are displayed in each report ID. So instead of dispalying 4 as the total, I would like it to display 6 (3 plus 3). Essentially, I'm trying to create a measure where the total distinct count is related to amount of sanctions in the report ID rather than the types of outcomes that are counted.

 

Don't know If I am doing anything wrong here but if more insight is needed, please let me know. Any would be much appreciated.

 

Thank you!

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

If @danextian solution does not work, (it should), try this!

Difference is I speced out the distinct count measure inline. 

 

Outcome Distinct Count =  
var _dc = CALCULATE( DISTINCTCOUNT(Table1[outcome]))

RETURN SUMX( VALUES(Table1[Report ID]), _dc)

  

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @investigatorjon ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

sevenhills
Super User
Super User

If @danextian solution does not work, (it should), try this!

Difference is I speced out the distinct count measure inline. 

 

Outcome Distinct Count =  
var _dc = CALCULATE( DISTINCTCOUNT(Table1[outcome]))

RETURN SUMX( VALUES(Table1[Report ID]), _dc)

  

danextian
Super User
Super User

Hi @investigatorjon 

 

Try either of these:

=
SUMX (
    SUMMARIZE ( data, data[report id], "@count", [distinctcount measure] ),
    [@count]
)
=
SUMX ( VALUES ( data[report id] ), [distinctcount measure] )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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