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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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