Forum Discussion
keckraguilar
2 years agoFrequent Visitor
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. ...
- 2 years ago
Hi,
PBI file attached.
Hope this helps.
danextian
2 years agoSuper 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 )
)
keckraguilar
2 years agoFrequent 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?