Forum Discussion

arcadefire4's avatar
arcadefire4
New Member
9 years ago
Solved

Filtering by data trend

Hi all,   I'm new to the forums so forgive me if this isn't explained that well. I'm trying to work out how it would be possible to show businesses whose sales are on a downward trend.    I have ...
  • v-ljerr-msft's avatar
    9 years ago

    Hi arcadefire4,

     

    If I understand you correctly, you should be able to follow steps below to sorting out the businesses in decline.

     

    I assume you have a table called 'Table1' like below.

     

     

    1. Use the formula below to create a new calculate column in 'Table1'.

    Is In Decline = 
    VAR previousMonthSales =
        CALCULATE (
            SUM ( Table1[Sales] ),
            ALLEXCEPT ( Table1, Table1[Business Name] ),
            PREVIOUSMONTH ( Table1[Month] )
        )
    VAR NextMonthSales =
        CALCULATE (
            SUM ( Table1[Sales] ),
            ALLEXCEPT ( Table1, Table1[Business Name] ),
            NEXTMONTH ( Table1[Month] )
        )
    RETURN
        IF (
            Table1[Sales] < previousMonthSales
                && Table1[Sales] > NextMonthSales
                && NextMonthSales <> 0,
            1,
            0
        )
    

     

    2. Then you should be able to use the new create calculate column as Slicer or visual level filter to sorting out the businesses in decline.

     

    Here is the sample pbix file for your reference. :smileyhappy:

     

    Regards