Forum Discussion

ChloeDL's avatar
ChloeDL
Frequent Visitor
4 years ago
Solved

Formula Help!!

Basically, we have this huge dataset with individual line items for every transaction which includes prj info, budget, fiscal year etc. First, we need a formula to get the cumulative spent by budget by year. Second we need a formula that will subtract the actuals from given total budget amount again by budget and fiscal. Thing is the dataset doesn’t have budget amounts. It has what was allocated and what was spent where we need to show when the “bucket” will run out of money. Here's an example of what we're trying to accoplish. 

 

 2018-2019  2019-2020  2020-2021  
 ActualsCumul. LeftActualCumul.LeftActualCumul.Left

B2018

6 10-6=461210-12=-(2)61810-18=-(8)
X1 10-1=91110-2=813

10-3=7

Y2 10-2=82410-4=62610-6=4
Z3 10-3=73610-6=43910-9=1
B20216 20-6=1461220-12=861820-18=2
X1 20-1=191220-2=181320-3=17
Y2 20-2=182420-4=162620-6=14
Z3 20-3=173620-6=143920-9=11

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  , ChloeDL 

     

    Is this result you want to achieve?

    you just need to create two new columns:

     

     

    sum = CALCULATE(SUM('Table'[actuals]),FILTER(ALL('Table'),'Table'[actuals]<=EARLIER('Table'[actuals])))

     

     

    value = 'Table'[TBbudget]-'Table'[sum]

     

    This is my testing PBIX  file.

     

    Best regards,

    Community Support Team Selina zhu

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

5 Replies

  • daXtreme's avatar
    daXtreme
    Solution Sage

    Hi ChloeDL 

     

    It's good you show what you want to accomplish, we appreciate that... but where the piece where you show your data and model?

    • ChloeDL's avatar
      ChloeDL
      Frequent Visitor

      Thanks for your response. Unfortunately, I work for GCC and cannot give you a screnshot of the data but I'm hoping this helps. Here's the formula we currently use for the cumulative spend. Which works well but doesn't seperate by "bucket of money".  We're using the matrix visuals to show each projects within each budget "bucket" and fiscal years either as columns or as a slicer. 

      Cumulative spent = CALCULATE(SUM(Append1[Actual Expenditures]),ALL('Append1'),Append1[FiscalYear] <= MAX('Append1'[FiscalYear]))
       
      Here's a screnshot of the relationships made, all of our data is within the Append1 table. 
       

       

      Here's a copy of our data columns, highlighted are the "used" columns for this requirement. 

      • daXtreme's avatar
        daXtreme
        Solution Sage

        Hi there.

         


        ChloeDL wrote:

        Basically, we have this huge dataset with individual line items for every transaction which includes prj info, budget, fiscal year etc. First, we need a formula to get the cumulative spent by budget by year. Second we need a formula that will subtract the actuals from given total budget amount again by budget and fiscal. Thing is the dataset doesn’t have budget amounts.

        I don't quite get this. In one sentence you say there's budget in the table, in another you say you don't have the budget amounts... Not sure if I can help here 😞

         

         

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  , ChloeDL 

     

    Is this result you want to achieve?

    you just need to create two new columns:

     

     

    sum = CALCULATE(SUM('Table'[actuals]),FILTER(ALL('Table'),'Table'[actuals]<=EARLIER('Table'[actuals])))

     

     

    value = 'Table'[TBbudget]-'Table'[sum]

     

    This is my testing PBIX  file.

     

    Best regards,

    Community Support Team Selina zhu

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