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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jwessel
Helper II
Helper II

Distinct Counting while finding max value of another field and summing them.

Hello,

I have a table resembling the below.  Being rather new to PowerBI, I am attempting to figure out the viz I am looking for.

The requirement of the vis is that it has one column identifying the number of unique clientID (count distinct, pretty easy). But, in addition to that I want to sum up the number of household members for each unique ID where the value to sum on would be the maximum # of household members for each unique client. ID.  Not sure how to do this and would appreciate any input.  Max household members for each ClientID is of red color.

Table
ClientIDHouseholdMembers
11
12
13
21
21
21
31
32

 

Expected Results
Unique ClientsHousehold members of Unique Clients
36
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@jwessel,

 

Try these measures:

 

Unique Clients = DISTINCTCOUNT ( Table1[ClientID] )
Household Members of Unique Clients = 
SUMX (
    VALUES ( Table1[ClientID] ),
    CALCULATE ( MAX ( Table1[HouseholdMembers] ) )
)

 

DataInsights_0-1648665954495.png

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@jwessel,

 

Try these measures:

 

Unique Clients = DISTINCTCOUNT ( Table1[ClientID] )
Household Members of Unique Clients = 
SUMX (
    VALUES ( Table1[ClientID] ),
    CALCULATE ( MAX ( Table1[HouseholdMembers] ) )
)

 

DataInsights_0-1648665954495.png

 





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

Proud to be a Super User!




Thank you very much !!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.