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! Request now

Reply
d2hughes
New Member

Count of Counts

Hello,

 

I am going to try this again, last time I posted it was marked as spam. I think it was because it was my first post and I included a link to a sample .pbix from my OneDrive.

 

I need to make a visualization of the counts of how many times people visited. The visits are represented like this:

ContactIDDate
11/1/2021
11/2/2021
21/1/2021
31/1/2021
31/2/2021
31/3/2021
41/1/2021
51/1/2021
51/2/2021
51/3/2021
51/4/2021
51/5/2021
61/1/2021
61/2/2021
71/1/2021
81/1/2021
91/1/2021
91/2/2021
91/3/2021

 

I have a measure that will give me the number of visits by ContactID:

Visits = COUNTROWS(FILTER('Visits',Visits[ContactID] = Visits[ContactID]))
 
When viewed on a table it looks correct:
ContactIDVisits
12
21
33
41
55
62
71
81
93

 

This is where I get lost. Somehow I need to get it to count these counts which could be represented like this:

VisitsCount of Visitors
14
22
32
40
51

 

Which lastly needs to be visualized like this:

Count of Counts Visualization.PNG

 

Any help would be greatly appreciated!

Thank you!

David

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @d2hughes 

 

Try this code to create a new table:

Table =
GROUPBY(
    SUMMARIZE(
        Visits,
        Visits[ContactID],
        "Visits", COUNTROWS( FILTER( 'Visits', Visits[ContactID] = Visits[ContactID] ) )
    ),
    [Visits],
    "Count of Visitors", COUNTX( CURRENTGROUP(), [ContactID] )
)

 

output:

VahidDM_0-1637565547976.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

3 REPLIES 3
d2hughes
New Member

Yes this looks correct! I made this a simple sample but it should translate to the actual data I am working on.

 

Thank you so much!

VahidDM
Super User
Super User

Hi @d2hughes 

 

Try this code to create a new table:

Table =
GROUPBY(
    SUMMARIZE(
        Visits,
        Visits[ContactID],
        "Visits", COUNTROWS( FILTER( 'Visits', Visits[ContactID] = Visits[ContactID] ) )
    ),
    [Visits],
    "Count of Visitors", COUNTX( CURRENTGROUP(), [ContactID] )
)

 

output:

VahidDM_0-1637565547976.png

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Sorry, I forgot one caveat. I need to be able to slice it by the date column. This table works fine for the whole data set but it is unaffected by a slicer on the base table's date. Any ideas?

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.