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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
xjianguk
Regular Visitor

How to count customers with revenue less than £5k?

Hi,


This might be an easy question but I'm struggling to find a solustion:

 

Basically I'm trying to calculate the distinct count of the customers who have revenue of less than £5000 (at customer level). 

 
An example of the data is as below. So there should be 3 customers that have revenue of below £5k.
 

xjianguk_1-1641559003692.png

 

 

My original formula is shown below this but it counts all the below 5k transaction at 'Job Number' level, not customer level. i.e. it returns with a distinct count of 5 instead of 3.

 

Count of Customer < £5k =
CALCULATE(
DISTINCTCOUNT('Table'[Customer]),
FILTER('Table','Table'[Revenue]<5000))
 
Many thanks for your help!
2 ACCEPTED SOLUTIONS
bcdobbs
Community Champion
Community Champion

Try this:

 

 

Count of Customer < £5k = 
VAR CustomerRevenue =
FILTER ( 
    SUMMARIZECOLUMNS (
        Revenue[Customer],
        "Revenue[Total Revenue]", CALCULATE ( SUM (Revenue[Revenue] ) )
    ),
    Revenue[Total Revenue] < 5000
)

RETURN COUNTROWS ( CustomerRevenue )

 

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

raimon
Resolver II
Resolver II

Hi @xjianguk,

 

Please use following measure - 

[Replace 'Customer Table' with the name of your table]

 

Measure = CALCULATE(DISTINCTCOUNT('Customer Table'[Customer]),filter(SUMMARIZE('Customer Table','Customer Table'[Customer],"total",SUM('Customer Table'[Revenue])),[total]<5000))

View solution in original post

5 REPLIES 5
raimon
Resolver II
Resolver II

Hi @xjianguk,

 

Please use following measure - 

[Replace 'Customer Table' with the name of your table]

 

Measure = CALCULATE(DISTINCTCOUNT('Customer Table'[Customer]),filter(SUMMARIZE('Customer Table','Customer Table'[Customer],"total",SUM('Customer Table'[Revenue])),[total]<5000))

Many thanks for your help! 

mh2587
Super User
Super User

COUNTAX(Table(customer),revenue>5k)


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



bcdobbs
Community Champion
Community Champion

Try this:

 

 

Count of Customer < £5k = 
VAR CustomerRevenue =
FILTER ( 
    SUMMARIZECOLUMNS (
        Revenue[Customer],
        "Revenue[Total Revenue]", CALCULATE ( SUM (Revenue[Revenue] ) )
    ),
    Revenue[Total Revenue] < 5000
)

RETURN COUNTROWS ( CustomerRevenue )

 

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Many thanks for your help!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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 Kudoed Authors