Forum Discussion

ErickReiis's avatar
ErickReiis
Helper I
4 years ago
Solved

DAX Projection Measure

Hello everyone, everything good ? I need help with DAX, I have the following projection calculation: Projection Units Sold Column = CALCULATE('Measures Units'[Units Sold] + [Monthly Growth No.]/12;...
  • v-luwang-msft's avatar
    4 years ago

    Hi ErickReiis ,

    As your data is not available, please refer to the following template.

    Base table:

     

    First ,create the below column about growth:

    monthgrowcolumn = 
    VAR TEQ =
        CALCULATE (
            MAX ( 'table'[Date] ),
            FILTER ( ALL ( 'table' ), 'table'[Date] < EARLIER ( 'table'[Date] ) )
        )
    RETURN
        IF (
            CALCULATE (
                MAX ( 'table'[value] ),
                FILTER ( ALL ( 'table' ), 'table'[Date] = TEQ )
            )
                = BLANK (),
            0,
            'table'[value]
                - CALCULATE (
                    MAX ( 'table'[value] ),
                    FILTER ( ALL ( 'table' ), 'table'[Date] = TEQ )
                )
        )

    Then we base on the table ,create a forecast table:

    Table2 = SELECTCOLUMNS('table',"Date",date(YEAR('table'[Date])+1,MONTH('table'[Date]),DAY('table'[Date])),"value",'table'[value]+AVERAGE('table'[monthgrowcolumn]))

     

    use the below measure:

    measure = IF(MAX(Table2[Date])<today(),0,1)

    Then create visual and filter:(As shown in the diagram, it shows data greater than the current month (which can be adjusted according to your actual needs)

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


    Best Regards

    Lucien