I have a simple budget table, that shows me the weekly budget: Week - Budget - Article
Now I would like to get a running total for the MTD comparision. For this purpose I divide the weekly budget by the number of working days:
Budget per Day = DIVIDE([Budget], [# Working Days per Week])
Since I have a fiscal calender with specific end and start dates for each month, I can't use the time intelligence functions with DAX. Therefore I have developed this function:
Budget MTD =
CALCULATE (
SUMX (
'Calendar',
[Budget per Day]
),
FILTER (
ALL ( 'Calendar' ),
'Calendar'[Fiscal Year]
= VALUES ( 'Calendar'[Fiscal Year] )
&& 'Calendar'[Fiscal Month Number]
= MAX ( 'Calendar'[Fiscal Month Number] )
&& 'Calendar'[Date]
<= MAX ( 'Calendar'[Date] )
&& 'Calendar'[IsWorkingDay] = 1
)
)
Somehow, I always get the Budget for the whole month. What is missing here?
I think somehow I need to add something like < = TODAY, right?
This measure will be used in a matrix with a filter for the current month.