Forum Discussion

Ritaf's avatar
Ritaf
Icon for Responsive Resident rankResponsive Resident
7 years ago
Solved

running total target

Hi, i'm tryin to create a measure for monthly target based on toatal yearly target and accomplished by the slised period. 

For exemple salesman have a rarget for year  - 1,000,000 $

until 04.04 he sold - 200,000$

his monthly target until december is (1,000,000 - 200,000)/ (12 - 4.13) = 101,651

how can i build this calculation?

Thanks ,

Rita

  • Ritaf something like this you can do and change as per your need

     

    Add new measure to calculate number of months

     

    Total Month = 
    VAR __today = TODAY() 
    VAR __eomDate = EOMONTH( __today, 0 )
    VAR __totalDaysInMonth = DAY( __eomDate )
    VAR __daysPassedInMonth = DAY( __today )
    VAR __totalMonthsPassed = MONTH( __today ) + DIVIDE( __daysPassedInMonth, __totalDaysInMonth )
    RETURN
        __totalMonthsPassed
    
    

     

    Add measure to perform calculation

     

    Running Total Target = 
    DIVIDE( SUM( Table[Target ] ) - SUM( Table[Sales] ), 12 - [Total Months] )

    You can combine all this in one if you want, totally your call.

4 Replies

  • Ritaf i guess you always want to caclulate as of today, in your example it April 04th, correct?

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        Ritaf something like this you can do and change as per your need

         

        Add new measure to calculate number of months

         

        Total Month = 
        VAR __today = TODAY() 
        VAR __eomDate = EOMONTH( __today, 0 )
        VAR __totalDaysInMonth = DAY( __eomDate )
        VAR __daysPassedInMonth = DAY( __today )
        VAR __totalMonthsPassed = MONTH( __today ) + DIVIDE( __daysPassedInMonth, __totalDaysInMonth )
        RETURN
            __totalMonthsPassed
        
        

         

        Add measure to perform calculation

         

        Running Total Target = 
        DIVIDE( SUM( Table[Target ] ) - SUM( Table[Sales] ), 12 - [Total Months] )

        You can combine all this in one if you want, totally your call.