Forum Discussion
Dynamic YTD Formula (DAX)
I have two tables, budget and sales. I want to create a dynamic ytd budget formula that only sums the data through the max month in the sales table. I already converted the month name to numbers. (not shown) Basically the current snapshot would sum the budget through February, and when I load the data for the next month (march) the formula will automatically update to sum the budget through march.
Hi,
PBI file attached.
Hope this helps.
13 Replies
- danextianSuper User
Hi keckraguilar
Please try this:
Dynamic Budget YTD = VAR MaxMonthInSales = CALCULATE ( MAX ( sales[month number] ), ALL ( sales ) ) RETURN CALCULATE ( SUM ( budget[amount] ), FILTER ( ALL ( budget ), budget[month] <= MaxMonthInSales ) )- keckraguilarFrequent Visitor
thanks for the resonse! the formula doesn't seem to be working. it is showing an inlfated number, not sure if it is still summing all months in the budget file?
- Ashish_MathurSuper User
Hi,
Why is there no Year column? Is the FY from July - June? Share data in a format that can be pasted in an MS Excel file.
- keckraguilarFrequent Visitor
How do I share an excel doc on here?
- Ashish_MathurSuper User
Upload it to Google Docs and share the download link. Please also answer the questions asked in my earlier message.