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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
et123
New Member

Totalling a distinct count measure

User Count = DISTINCTCOUNT('View Data'[DisplayName])
 
If I am using his meansure in a matrix I need the total to be a total of the distinct counts.  I had seen a suggesion to use HASONEFILTER but not sure how to apply it to this measure to make it work correctly.
2 ACCEPTED SOLUTIONS
timalbers
Super User
Super User

Hi @et123 

 

try something like this:

User Count = 
SUMX( 
   VALUES( 'View Data'[DisplayName] ), 
   DISTINCTCOUNT( 'View Data'[DisplayName] )
)

—————————————————————————————
✔️ If my answer helped you, please consider marking it as a solution.

View solution in original post

mark_endicott
Super User
Super User

@et123 - If I interpret your requirement correctly you need every row to show the same total, e.g. each row will show the total of the DISTINCTCOUNT('View Data'[DisplayName]), in which case this should work:

 

CALCULATE
   DISTINCTCOUNT( 'View Data'[DisplayName] ),
   REMOVEFILTERS( 'View Data' )
)

 

If this works, please accept as the solution, it helps with visibility for others with the same challenge, if it does not, please provide more information about what you are trying to acheive, and some sample data. 

View solution in original post

4 REPLIES 4
mark_endicott
Super User
Super User

@et123  - did we resolve your issue? If we did, please select the appropriate solution, it helps with visibility for others and for SuperUsers to keep their status! Thanks!

Anonymous
Not applicable

Hi @et123 ,

similar situation

 

Measure = 
DISTINCTCOUNT('Table'[Column])
Measure 2 = 
VAR _table = SUMMARIZE('Table',[Type],"Result",[Measure])
RETURN
SUMX(_table,[Result])

 

vzhouwenmsft_1-1734491152841.png

 

 

Best Regards

mark_endicott
Super User
Super User

@et123 - If I interpret your requirement correctly you need every row to show the same total, e.g. each row will show the total of the DISTINCTCOUNT('View Data'[DisplayName]), in which case this should work:

 

CALCULATE
   DISTINCTCOUNT( 'View Data'[DisplayName] ),
   REMOVEFILTERS( 'View Data' )
)

 

If this works, please accept as the solution, it helps with visibility for others with the same challenge, if it does not, please provide more information about what you are trying to acheive, and some sample data. 

timalbers
Super User
Super User

Hi @et123 

 

try something like this:

User Count = 
SUMX( 
   VALUES( 'View Data'[DisplayName] ), 
   DISTINCTCOUNT( 'View Data'[DisplayName] )
)

—————————————————————————————
✔️ If my answer helped you, please consider marking it as a solution.

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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