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
HSmith
Regular Visitor

Declining Spend across Multiple Months

Hi,

 

I am trying to build a report which brings forward information about customers who we have continued to see a decline in spend each month for 3-4 months so that this can be used as a flag to see if customers are at risk of being lost. 

 

I'd like this to be able to filter out those who do not fulfill this requirement and then be able to drill down into detailed information for those who this does apply to.

 

Not real data below (this would link to multiple tables based on invoice number / date / measures etc) and in this example it would only pull forward ABC and BCD:

Invoice numberAccount CodeRevenueDate
1ABC4001/01/2016
4ABC3005/02/2016
8ABC2009/03/2016
11ABC1018/04/2016
2BCD8001/01/2016
5BCD4003/02/2016
6BCD2005/02/2016
9BCD5009/03/2016
12BCD2018/04/2016
3CDE5001/01/2016
7CDE6005/02/2016
10CDE7009/03/2016
13CDE6018/04/2016

 

 

Any help much appreciated,

 

Holly

 

 

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@HSmith

 

Hi,

 

First, we can add a flag first. If the total of this month is smaller than that of last month, we add “-1”, or add “1”. This formula is generated according to your data.

 

Flag =
VAR LastMonthSum =
    CALCULATE (
        SUM ( Table1[Revenue] ),
        FILTER (
            'Table1',
            'Table1'[Account Code] = EARLIER ( 'Table1'[Account Code] )
                && MONTH ( 'Table1'[Date] )
                    = ( MONTH ( EARLIER ( 'Table1'[Date] ) ) - 1 )
        )
    )
VAR CurrentMonthSum =
    CALCULATE (
        SUM ( Table1[Revenue] ),
        FILTER (
            'Table1',
            'Table1'[Account Code] = EARLIER ( 'Table1'[Account Code] )
                && MONTH ( 'Table1'[Date] ) = MONTH ( EARLIER ( 'Table1'[Date] ) )
        )
    )
RETURN
IF ( CurrentMonthSum < LastMonthSum, -1, 1 )

 

Second, we can sum the flags of three month. There are a few questions.

  1. 3 – 4 months mean the latest 3 – 4 months or any 3 – 4 month?
  2. Are there any other tables that can change the total revenue?

 

Suggestions: sum up the flag, if the total is -3, it’s a target.

Declining Spend across Multiple Months.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.