Forum Discussion

jabrillo's avatar
jabrillo
Icon for Helper I rankHelper I
1 year ago
Solved

Monthly Burn Rate

I want to create a line chart of monthly burn rate. This is how my file looks like:

PeriodActual Cost
1100
2120
3140
4100

This is what I want to accomplish:

PeriodBurn RateCalculation
1100100/1
2110220/2
3120360/3
4115460/4

I tried this dax formula:

Burn Rate =

   VAR _PeriodCount = selectedvalue([Period])

   VAR _ActualCost = calculate(sum([Actual Cost]), [Period] <= max([Period]))

   VAR _BurnRate = divide(_ActualCost, _PeriodCount)

   RETURN _BurnRate

The burn rates for periods 2 to 4 were calculated incorrectly. Instead of dividing the YTD cost by the number of periods, it was dividing the cost of that period by the number of periods. What's wrong?

 

  • lbendlin's avatar
    lbendlin
    1 year ago

    why should it be a measure?  Can it be impacted by user filters?

     

    Please provide sample data that fully covers your issue.
    Please show the expected outcome based on the sample data you provided.

8 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    jabrillo Try:

    Burn Rate =
       VAR _Period = MAX( 'Table'[Period] )
       VAR _Table = FILTER( ALL( 'Table' ), [Period] <= _Period )
       VAR _ActualCost = SUMX( _Table, [Actual Cost] )
       VAR _BurnRate = DIVIDE( _ActualCost, _Period )
    RETURN 
       _BurnRate
    • jabrillo's avatar
      jabrillo
      Icon for Helper I rankHelper I

      The table would also have Project ID as another column. So the table looks like this:

      Project IDPeriodActual Cost
         
         
         
         
  • Burn Rate = 
    var p = [Period]
    return DIVIDE(SUMX(FILTER('Table',[Period]<=p),[Actual Cost]),p)

     

    • jabrillo's avatar
      jabrillo
      Icon for Helper I rankHelper I

      If Burn Rate is a measure, var p = [Period[ is not valid.

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

        why should it be a measure?  Can it be impacted by user filters?

         

        Please provide sample data that fully covers your issue.
        Please show the expected outcome based on the sample data you provided.

  • v-menakakota's avatar
    v-menakakota
    Icon for Community Support rankCommunity Support

    Hi jabrillo ,

    May I ask if you have resolved this issue?If not,please share the sample data. If it resolved , please share the solution here. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

    • v-menakakota's avatar
      v-menakakota
      Icon for Community Support rankCommunity Support

      Hi @jabrillo ,

      May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

      Thank you.

      • v-menakakota's avatar
        v-menakakota
        Icon for Community Support rankCommunity Support

        Hi jabrillo ,

        Can you please confirm whether you have resolved issue. If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. This will be helpful for other community members who have similar problems to solve it faster. 

        If we don’t hear back, we’ll go ahead and close this thread.Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.



        Thank you,
        Menaka