cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Group by Customer, sum by Month, and then apply filter

I have a table of invoices and need to filter out customers who had sales greater than 10,000 for a given month.  

 

So I need a function that can sum actual invoices by customer, then by month, and then remove if the total sales for that customer were greater than 10,000 for that given month.  

we want to perform an analysis of customers who had greater than 10K months and customers who had less than 10K months, but I need to hard code the fitler not rely on the visual filters.  

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

 

Without any data details is difficult to give you a measure that will adapt to your model.

 

But in a general way you need to have a measure like this:

 

Filter_Out_Above_10K =
SUMX (
    FILTER (
        SUMMARIZE (
            Table1;
            Table1[Customer];
            Table1[Date];
            "Total Invoice"; SUM ( Table1[Value] )
        );
        [Total Invoice] < 10000
    );
    [Total Invoice]
)

As you can see below on the image of the left is the table with the measure on the right is the full dataset the 10K is missing from left image.

 

filter_measure.png

 

Regards,

MFelix

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Anonymous,

 

Without any data details is difficult to give you a measure that will adapt to your model.

 

But in a general way you need to have a measure like this:

 

Filter_Out_Above_10K =
SUMX (
    FILTER (
        SUMMARIZE (
            Table1;
            Table1[Customer];
            Table1[Date];
            "Total Invoice"; SUM ( Table1[Value] )
        );
        [Total Invoice] < 10000
    );
    [Total Invoice]
)

As you can see below on the image of the left is the table with the measure on the right is the full dataset the 10K is missing from left image.

 

filter_measure.png

 

Regards,

MFelix

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

Hi @Anonymous,

 

You should use something like this:

 

Filter_Out_Above_10K =
SUMX (
    FILTER (
        SUMMARIZE (
            Table1;
            Table1[Date];
            "Count Customer";
            DISTINCTCOUNT(Table1[Customer]);
            "Total Invoice"; SUM ( Table1[Value] )
        );
        [Total Invoice] < 10000
    );
    [Count Customer]
)

I think this will work.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

This is amazing!  

What modification if I wanted to take that same table and count the number of customers contributed to those numbers

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!