Forum Discussion

Danch89's avatar
Danch89
Frequent Visitor
4 years ago
Solved

Turn Monthly Budget into Cumulative Daily Graph

I have a table with sales budgets with a starting date for the month ahead along with a total budget for the whole month. I'd like to show a line graph with days of month showing this budget as a daily cumulative total.

 

For Example

DateBudget
1st Jan 2250,000
1st Feb 2280,000
1st Mar 22125,000
  • Hi Danch89 ,

     

    The key is to have a date dimension and have a year offset to filter out only the years you’re interested in showing.

    Try the following formula:

    Year Offset = YEAR(TODAY())-‘Date'[Year]
    Rolling 12 Months Sales =
    CALCULATE (
        SUM ( 'Sales Fact'[Revenue] ),
        DATESBETWEEN (
            'Date'[Date],
            NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Date'[Date] ) ) ),
            LASTDATE ( 'Date'[Date] )
        )
    )


    If the problem is still not resolved, please point it out. Looking forward to your reply.


    Best Regards,
    Henry


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

3 Replies

    • Danch89's avatar
      Danch89
      Frequent Visitor

      Thanks - I've got the daily target but I still don't know how to change this into a rolling month. For example below. I'd want to cumulative total that daily target each day for the month to show a month trend against target.

       

       

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi Danch89 ,

     

    The key is to have a date dimension and have a year offset to filter out only the years you’re interested in showing.

    Try the following formula:

    Year Offset = YEAR(TODAY())-‘Date'[Year]
    Rolling 12 Months Sales =
    CALCULATE (
        SUM ( 'Sales Fact'[Revenue] ),
        DATESBETWEEN (
            'Date'[Date],
            NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Date'[Date] ) ) ),
            LASTDATE ( 'Date'[Date] )
        )
    )


    If the problem is still not resolved, please point it out. Looking forward to your reply.


    Best Regards,
    Henry


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