Forum Discussion
MTD Budget from a table that includes an equally distributed monthly budget??
- 9 years ago
Phil_Seamark , thank you for your help.
I tweaked your solution slightly to get the number I needed.
MTD Budget = CALCULATE (SUM(dimBudget[Budget]),
FILTER (
ALL ( dimDate ),
'dimDate'[Month Number] = MAX ( 'dimDate'[Month Number] )
&& 'dimDate'[Date] <= MAX ( dimVendorMetrics[Date] )))
Hi scaast
I think this pattern is possibly what you are looking for
MTD Budget = CALCUATE (SUM(dimBudget[Budget]),
FILTER ( ALL ( dimDate ), 'dimDate'[YearMonthNumber] = MAX ( 'dimDate'[YearMonthNumber] ) && 'dimDate'[Date] <= MAX ( 'dimDate'[Date] ) )
Thanks Phil_Seamark
My dimDate table has the following columns available:
Date
Day of Week
Month
Month Number
Quarter
Week Number
Year
I edited your solution to this:
MTD Budget = CALCULATE (SUM(dimBudget[Budget]),
FILTER (
ALL ( dimDate ),
'dimDate'[Month Number] = MAX ( 'dimDate'[Month Number] )
&& 'dimDate'[Date] <= MAX ( 'dimDate'[Date] )))
This still resulted in the entire month budget amount being provided, rather than MTD.
- Phil_Seamark9 years ago
Microsoft Employee
Do you have a 1 to many relationship between dimBudget and dimDate?
Are both columns Date?
- Phil_Seamark9 years ago
Microsoft Employee
I've built a small PBIX file with it working here which you can download to have a play
Both formulas should be working ok.
- scaast9 years agoFrequent Visitor
Phil_Seamark , thank you for your help.
I tweaked your solution slightly to get the number I needed.
MTD Budget = CALCULATE (SUM(dimBudget[Budget]),
FILTER (
ALL ( dimDate ),
'dimDate'[Month Number] = MAX ( 'dimDate'[Month Number] )
&& 'dimDate'[Date] <= MAX ( dimVendorMetrics[Date] )))