Forum Discussion

joshua1990's avatar
joshua1990
Icon for Post Prodigy rankPost Prodigy
6 years ago

WTD running total based on DIVIDE

Hello everyone!

I have a measure that shows me the daily budget level based on a weekly target:

 

Sales Phasing = DIVIDE([Budget], [# Working Days per Week])

 

[Budget] is a column based on a year-week granularity.

To get the daily target I divide the budget by the number of working day per week.

Now I would like to accumulate this daily budget by month.

Something like:

DateDaily BudgetMTD Budget
01.01.20195050
02.01.201950100
03.01.201925125

 

How would you do that?

I guess a simple running total will not work based on the result of a DIVID function, right?

This is my MTD measure for the actual sales:

 

Sales MTD = 
CALCULATE (
    [Sales],
    FILTER (
        ALL ( 'Calendar' ),
        'Calendar'[Fiscal Year]
            = MAX ( 'Calendar'[Year] )
            && 'Calendar'[Date]
                <= MAX ( 'Calendar'[Date] )
            && 'Calendar'[Fiscal Month Number]
                = MAX ( 'Calendar'[Fiscal Month Number] )
    )
)

 

4 Replies

    • joshua1990's avatar
      joshua1990
      Icon for Post Prodigy rankPost Prodigy

      amitchandak Thanks for your help!

      In your provided file I can't find a running total measure, just da daily target allocation.

      Cou you please help?

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

        joshua1990 , allocate it daily and WTD /MTD as a measure.

        You have given output

        Can you share sample data and sample output in table format?

  • Anonymous's avatar
    Anonymous
    Not applicable
    That's actually very easy once you start thinking in Power BI and DAX terms. You need daily target? Then create a table that will store each and every day in the range you want and assign the right amount to these days. Then connect to the table a Date table and you'll be able to aggregate any way you want and create any measures quickly and simply. Please do not make mistakes that so many do because their thinking is rigid. Simpler DAX means easier to understand and faster to execute.