cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper V

## Find distinct values by group, then sum of this

Hello,

I have a database of job applicants.  To find total  applicants, if they applied multiple times in one month, it counts as one, if they apply in multiple months, count each month.  So basically,

CALCULATE(DISTINCTCOUNT(Table[Inquired Month]))
This works on the individual level in a table, email and this measure, how many distinct months did each person apply.  I need to find a grand total, take the total months by each email and sum this...Unsure of the syntax?
1 ACCEPTED SOLUTION
Super User

Hi @aashton
The dax you need :

SumDistinctCounts =
SUMX(
SUMMARIZE(
'Emails by Month',
'Emails by Month'[Email],
"DistinctMonths", DISTINCTCOUNT('Emails by Month'[Month])
),
[DistinctMonths]
)

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

9 REPLIES 9
Super User

Hi @aashton

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

Helper V

I need a measure that adds up each emails distinct months, this should be 7:  (I don't see where I can attach a file)

Super User

Hi @aashton

it seems :
months count = distinctcount ('your table[month])

The way to share the file :
save it in ondrive / google drive / etc... and to share a link

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Helper V

That only works for each email.  I need the total of all emails together, see screenshot, this adds up to 7 not 3:

Super User

You need to select share by link option there, not just copy a link and give it

Helper V
Super User

Hi @aashton
The dax you need :

SumDistinctCounts =
SUMX(
SUMMARIZE(
'Emails by Month',
'Emails by Month'[Email],
"DistinctMonths", DISTINCTCOUNT('Emails by Month'[Month])
),
[DistinctMonths]
)

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Helper V

That is great, that works!!! @Ritaf1983 I appreciate your help so  much!!!!!!

Super User

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors