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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calculate a grouped count based on a previous grouped count

I have a table with Customer IDs and Contact IDs. I need to count how many Contacts I have per Customer, which I can get. I need to then count how many Customers are at each count of touchpoints.

Example:

 

Customer IDContact ID
1100
1101
1102
2103
2104
3105
3106
3107

 

Then goes to:

 

Customer IDContact Count
13
22
33

 

Then:

 

Customer Count per Contact CountContact Count
12
23

 

I've tried this but it isn't working. I'm not sure I'm on the right track or not.

 

Measure Test =
VAR __Table =
GROUPBY(
'Contact History Five Quarters Ago',
'Contact History Five Quarters Ago'[Contact_Donor_Id],
"Count",SUM('Contact History Five Quarters Ago'[Contact_Count])
)
var __table2 =
GROUPBY(
__Table,
[Count],
"Count2",COUNTX( CURRENTGROUP(),'Contact History Five Quarters Ago'[Contact_Donor_Id])
)
RETURN __table2
 
Thanks,
 
Sean
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Another way you can do it is using Group By feature in Query Eidtor with two group by operations.3.PNG

4.PNG

5.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Another way you can do it is using Group By feature in Query Eidtor with two group by operations.3.PNG

4.PNG

5.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

 

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

A little tough to follow but sounds like you perhaps want a disconnected table. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.