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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors