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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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



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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors