Forum Discussion
DAX formula
Anonymous , you can modify the measure to dynamically calculate the value for the current month.
CurrentMonthRFTYTD =
VAR CurrentMonth = MONTH(TODAY())
VAR CurrentYear = YEAR(TODAY())
VAR MaxDate = MAX('analysis vwTime'[Date])
VAR MaxMonth = MONTH(MaxDate)
VAR MaxYear = YEAR(MaxDate)
RETURN
IF(
MaxMonth > CurrentMonth && MaxYear >= CurrentYear,
BLANK(),
DIVIDE(
CALCULATE(
SUM('API RFT'[RFT]),
FILTER(
'analysis vwTime',
YEAR('analysis vwTime'[Date]) = CurrentYear &&
MONTH('analysis vwTime'[Date]) = CurrentMonth
)
),
CALCULATE(
COUNT('API RFT'[RFT]),
FILTER(
'analysis vwTime',
YEAR('analysis vwTime'[Date]) = CurrentYear &&
MONTH('analysis vwTime'[Date]) = CurrentMonth
)
)
) / 100
)
For your API RFT % Change MoM measure, you can keep it as is, since it relies on the CurrentMonthRFTYTD measure to provide the current month's data.
API RFT % Change MoM =
VAR CurrentMonthRFTYTD = [CurrentMonthRFTYTD]
VAR PreviousMonthRFTYTD = [PreviousMonthRFTYTD]
RETURN
IF(
ISBLANK(CurrentMonthRFTYTD) || ISBLANK(PreviousMonthRFTYTD),
BLANK(), -- Return BLANK instead of 0
CurrentMonthRFTYTD - PreviousMonthRFTYTD
)