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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Filter Customers based on 12 month sales totals

I can't seem to find anything online answering this kind of question which is odd because it seems like a relatively common issue that would occur.

 

I am trying to create a measure that will give me a count of customers that have over $500 in sales over the last 12 months. I have a measure that gives me customer counts and another that will give a customers 12 month sales total. The problem I am getting is that when I try to filter on customers with sales amounts over $500 I am only getting a count of customers with at least a single order over $500 for the past 12 months. This will not account for customers with multiple smaller orders that cumilate to over $500.

 

I am assuming the calculation I am looking for has something to do with SUMX, but it seems to be finicky when it comes to filters.

 

My current database is normalized and has a Customer dimension table with all relevant customer info as well as a Sales fact table. I have a date table as well which is what I use for my time-intelligence measures.

 

Any help would be greatly appreciated

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Based on my assumption, table structure looks like below:

1.PNG

 

Please try measures: (In my test, I calculated total sales in last 3 month)

Total Sales last 12 month =
CALCULATE (
    SUM ( 'Sales Fact Table'[Sales] ),
    FILTER (
        ALLEXCEPT ( 'Sales Fact Table', 'Sales Fact Table'[Customer] ),
        'Sales Fact Table'[Date].[MonthNo] < MONTH ( TODAY () )
            && 'Sales Fact Table'[Date].[MonthNo]
                >= MONTH ( TODAY () ) - 3
    )
)


Count customer =
CALCULATE (
    DISTINCTCOUNT ( 'Sales Fact Table'[Customer] ),
    FILTER ( ALL ( 'Sales Fact Table' ), [Total Sales last 12 month] >= 500 )
)

Table visual.

2.PNG

 

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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
Ashish_Mathur
Super User
Super User

Hi,

 

Share the link from where i can download your file.  Also, show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur

 

I'm sorry, but that's not possible. I don't believe downloading my file would be of much use in any case. In addition, I'm not sure what the expected result would be which is why I'm trying to determine this measure.

 

The relevant tables in my dataset is a simple Customer dimension and a Sales Fact table. Is there a way to filter out total customer sales below a certain amount over a 12 month period? For example, a count of customers whose total sales are over $500 over 12 months

Hi @Anonymous,

 

Based on my assumption, table structure looks like below:

1.PNG

 

Please try measures: (In my test, I calculated total sales in last 3 month)

Total Sales last 12 month =
CALCULATE (
    SUM ( 'Sales Fact Table'[Sales] ),
    FILTER (
        ALLEXCEPT ( 'Sales Fact Table', 'Sales Fact Table'[Customer] ),
        'Sales Fact Table'[Date].[MonthNo] < MONTH ( TODAY () )
            && 'Sales Fact Table'[Date].[MonthNo]
                >= MONTH ( TODAY () ) - 3
    )
)


Count customer =
CALCULATE (
    DISTINCTCOUNT ( 'Sales Fact Table'[Customer] ),
    FILTER ( ALL ( 'Sales Fact Table' ), [Total Sales last 12 month] >= 500 )
)

Table visual.

2.PNG

 

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.