Forum Discussion

JoeHazelton's avatar
JoeHazelton
Frequent Visitor
5 years ago
Solved

Budget Split over months

Dear all,

 

I am hopinmg that someone can assist as i am new to BI.

 

I have a set of data which shows a few different schemes with their yearly allocated budget shown against them. I have managed to calulate the daily burn rate by dividing the budget by the number of working days the task takes. (blue data).

 

Ultimately what i require is on the right under the green columns which shows the budget split equally over the months where the works are planned.

 

Any help on this would be greatly appreciated. Happy to provide more info if needed.

 

Joe

 

ProgrammeStart DateFinish DateAllocated BudgetTask DurationDaily Burn RateFebMarAprMay
Scheme 101/02/202112/02/2021199,3401019,934199,340   
Scheme 215/02/202115/03/2021154,700207,73577,35077,350  
Scheme 322/02/202115/03/202150,000153,33325,00025,000  
Scheme 422/02/202126/11/2021400,0002002,00040,00040,00040,00040,000
Scheme 501/03/202105/03/20211,000,0005200,000 1,000,000  
Scheme 601/03/202119/03/202187,000155,800 87,000  
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi JoeHazelton ,

     

    Create columns as below.

    feb = IF(2>=MONTH('Table'[Start Date])&&2<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())
    
    mar = IF(3>=MONTH('Table'[Start Date])&&3<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())
    
    apr = IF(4>=MONTH('Table'[Start Date])&&4<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())
    
    may = IF(5>=MONTH('Table'[Start Date])&&5<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())

     

    Best Regards,

    Jay

7 Replies

  • JoeHazelton's avatar
    JoeHazelton
    Frequent Visitor

    Hi Amit,

     

    Thank you for youre reply. I found the links very useful and it gave me more direction than i had. However as i am still trying to understand relationship between tables im still struggling to get my end result.

     

    I would love my matrix table to show Schemes on the (Y axis) and values per month split equally across the months that the work is undertaken (x axis). I have attached my Pbix file for you to view. I have manually created my calendar table but its this last step im stuck on.

     

    I have calculated the amount of months that the work takes (DATEDIFF) and the number of days but i need the yearly allocated budget split evenly across the mohts of the work,

     

    I hope this makes sense. Would be great for some further pointers.

     

    For some reason this forum will not let me add my pbix file. I have provided a screen shot below.

     

     

    Joe

     

     

     

  • stevedep's avatar
    stevedep
    Memorable Member

    You can start with a datediff between start and finish and divide the budget by the number of months. You can use an IF statement to check if that value should be displayed (aka the month is within the timeframe). 

    • JoeHazelton's avatar
      JoeHazelton
      Frequent Visitor

      Hi Steve,

       

      Sounds a like a plan, although i wouldnt know where to start as my DAX is very basic. Would you be able to provide an example of these which i could then adapt and apply?

       

      Thanks

      • stevedep's avatar
        stevedep
        Memorable Member

        You can start by writing this datediff measure. Something likeDATEDIFF(MIN( Calendar[Start Date] ), MIN( Calendar[Finish Date]), MONTH ).

        And see if this works. Then divide the measure with your budget by the previous result. 

        One step at a time..

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JoeHazelton ,

     

    Create columns as below.

    feb = IF(2>=MONTH('Table'[Start Date])&&2<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())
    
    mar = IF(3>=MONTH('Table'[Start Date])&&3<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())
    
    apr = IF(4>=MONTH('Table'[Start Date])&&4<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())
    
    may = IF(5>=MONTH('Table'[Start Date])&&5<=MONTH('Table'[Finish Date]),'Table'[Allocated Budget]/(DATEDIFF('Table'[Start Date],'Table'[Finish Date],MONTH)+1),BLANK())

     

    Best Regards,

    Jay

    • JoeHazelton's avatar
      JoeHazelton
      Frequent Visitor

      Hi Jay,

       

      Really appreciate a different view on this. I have made my report now work the way it needs to. 

       

      Thank you so much for your support.