Forum Discussion
juju
9 years agoHelper III
MTD Calculation
I am using the formula below to pull the MTD value from the previous day. I'd like to make the value of the first day of each month blank - so it doesnt pull from the last day of the previous mon...
- 9 years ago
All set. Managed to get it working with this :
Previous Day MTDcALC = IF ( FactTable[Date] = STARTOFMONTH(FactTable[Date]), BLANK(), TOTALMTD ( CALCULATE ( CALCULATE ( SUM(FactTable[Value]), FILTER ( FactTable, FactTable[Channel]= "MyChannel" ) ) ), PreviousDay (FactTable[Date]) ) )Thxxxx
dkay84_PowerBI
9 years agoMicrosoft Employee
I will try to play around with this tomorrow but can you confirm that you have a day slicer to choose a day and you want to return a MTD value up to the day prior to the one selected (unless day of month = 1).
juju
9 years agoHelper III
All set. Managed to get it working with this :
Previous Day MTDcALC =
IF ( FactTable[Date] = STARTOFMONTH(FactTable[Date]), BLANK(),
TOTALMTD (
CALCULATE (
CALCULATE (
SUM(FactTable[Value]),
FILTER (
FactTable,
FactTable[Channel]= "MyChannel"
)
)
),
PreviousDay (FactTable[Date])
)
)
Thxxxx
- v-huizhn-msft9 years agoMicrosoft Employee
Hi juju,
I am very glad to hear you have resolved your problem. Please mark the corresponding replay as answer, which will help other people find solution easily and clearly.
Best Regards,
Angelia