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
PuddleRunna
Advocate I
Advocate I

COUNTA of occurences in Column A with distinct of Column C

Hi again,

 

I have a pretty simple measure that counts the number of software assignements on an asset (

SW Package count = COUNTA(Softwarezuweisung[Hostname])). 
 
Now I have occurences where the same asset has 2 or more users assigned. If I filter my visuals on User 1, it'll return a count of e.g. 4 although the user has only 2 packages (My visuals also display the packages itself, so the "discrepancy" is noticable).
 
Table "Softwarezuweisung":
 
HostnameSW PackageUser
123456Package 1Jane Doe
123456Package 1John Doe
123456Package 2Jane Doe
123456Package 2John Doe
 
 Also, if I filter for both users, both come back with a count of 4:
UserSW Package Count
Jane Doe4
John Doe4

 

How do I adjust the measure to count the occurences per asset and per user? 

Something with Calculate, Counta and Filter? Not sure how to even approach this 🙂

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@PuddleRunna 

maybe you can try this

Measure 2 = CALCULATE(COUNTROWS('Table (2)'),FILTER(all('Table (2)'),'Table (2)'[Hostname]=MAX('Table (2)'[Hostname])))

1.PNG





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

Proud to be a Super User!




View solution in original post

@PuddleRunna 

like what @Hariharan_R said, COUNTA should return 2 for each user and 4 for total. please provide the expected output





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Hariharan_R
Solution Sage
Solution Sage

Hi

By defult it shows 2 only as a result. Please share the expected result for more clarity.

Hariharan_R_0-1623825359448.png

Thanks

Hari

Hi @Hariharan_R , @ryan_mayu 

 

Got it to work now by tweaking the FILTER Section:
Calculate Measure = CALCULATE(COUNTA(Softwarezuweisung[Hostname]),FILTER(all(Softwarezuweisung),Softwarezuweisung[User]=MAX(Softwarezuweisung[User])))
 
Thanks a lot for your help on this. Didn't even know where to start 🙂
PuddleRunna
Advocate I
Advocate I

Hi @ryan_mayu ,

this still returns 4 per user when I would expect a total of 2 for each and an overall total of 4.

@PuddleRunna 

like what @Hariharan_R said, COUNTA should return 2 for each user and 4 for total. please provide the expected output





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

Proud to be a Super User!




ryan_mayu
Super User
Super User

@PuddleRunna 

maybe you can try this

Measure 2 = CALCULATE(COUNTROWS('Table (2)'),FILTER(all('Table (2)'),'Table (2)'[Hostname]=MAX('Table (2)'[Hostname])))

1.PNG





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

Proud to be a Super User!




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!

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