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

How to calculate actual counts per repeating customer

Hello folks,

 

I have somewhat easy task but I can't get it to work. I need to get the actual counts of repeating customer. I get the repeating customers measure but it doesn't have the counts. This is the code:

 

Repeating Customers =
COUNTROWS(
FILTER(
VALUES( 'Order'[AccountId] ),
CALCULATE( COUNTROWS( 'Order' ) ) > 1
)
)
 
Now I need to get actual counts of repeating customers. So for instance I need to have that structure:
Customer   Count
A                2
B                5
C                3
And so forth. Just to give a clearer specs. I will need to use that distinct count as a clicer and in visuals. So, in a clustered column chart I would put the sum of counts and the counts values:
count = 3
sum of distinct counts = 150
count = 4
sum of distinct couns = 70
count = 5
sum of distinct counts = 138
 
I hope I explained it well. Let me know if this is not clear.
Thanks,
Stan
5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous,

Please share some dummy data and expected results for test, it will help to test coding formula.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

AntrikshSharma
Super User
Super User

I believe it should be like this:

Repeating Customers =
COUNTROWS (
    FILTER ( VALUES ( Customer[Column] ), CALCULATE ( COUNTROWS ( 'Order' ) ) > 1 )
)

 

Anonymous
Not applicable

This also gives me a count of 1 per each repeating customer. I need actual row count per customer. 

amitchandak
Super User
Super User

@Anonymous , Try like

countx(filter(summarize('Order', 'Order'[AccountId], "_1", countrows('Order')),[_1]>1),[AccountId])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you but this just gives me a set of repeating customers. If I pull an AccountId to matrix and then the new measure I just see a list of repeating customers with the count of 1 for each. I need to have actual count of rows per repeating customer. 

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.

Top Solution Authors