Hello @ammu,
Firstly, I would like to apologize to you for not getting back early to you since I got stuck up in my work.
And finally here’s some good news about the result that you’re looking for. Below is the formula as well as the screenshot of the final output provided for the reference -
Total Actuals =
CALCULATE( SUM( Transactions[NetBalance] ) ,
Transactions[Book] = "MAIN" ,
ALL( DateTable[Month] ) ) * -1
LYTD Actuals - 1 =
VAR SelectedYear = SELECTEDVALUE( DateTable[Year] )
RETURN
IF( SelectedYear = 2020 ,
BLANK() ,
CALCULATE(
CALCULATE( [Total Actuals] ,
ALL( DateTable[Year] ) ,
DateTable[FY] = 2020 ) ) * -1 )
Now, you’ll observe that inspite of slicer selection for Month the result is absolutely static the way you wanted to see.
Lastly before I sign off from this post, there are certain recommendations that I would like to make to you as far as formula building is concerned -
- Always build the primary formulas and then go for the measure branching teachnique or variable technique (provided you’re good with it). Right now, I’ve observed that you don’t have a single primary formula in your file and have been using the same set of conditions again and again in all the formula’s that you’ve build. That is -
You can simply create “Total Actuals” and “Total Budgets” formula like this -
Total Actuals =
CALCULATE( SUM( Transactions[NetBalance] ) ,
Transactions[Book] = "MAIN" ,
ALL( DateTable[Month] ) ) * -1
Total Budgets =
CALCULATE( SUM( Transactions[NetBalance] ) ,
Transactions[Book] = "SCC_BUDGET" ) * -1
And now, based onto this primary formula, you can simply create the MTD and YTD formulas.
-
The reason behind why I strongly recommend to build the primary measures is because the way your formula was structured to calculate the LY Actuals was like this -
LY Act =
CALCULATE( SUM(Transactions[NetBalance] ) ,
Transactions[Book]= "MAIN" ,
DATEADD( DateTable[Date] , -1 , YEAR ) )
Whereas the actual formula, should have been like this if you don’t want to build the primary measures -
LYTD Actuals - 2 =
VAR SelectedYear = SELECTEDVALUE( DateTable[Year] )
RETURN
IF( SelectedYear = 2020 ,
BLANK() ,
CALCULATE(
CALCULATE( SUM( Transactions[NetBalance] ) ,
Transactions[Book] = "MAIN" ,
ALL( DateTable[Month] ) ,
ALL( DateTable[Year] ) ,
DateTable[FY] = 2020 ) ) )
Final Output between the formulas - “LY Act V/s LYTD Actuals - 1 V/s LYTD Actuals - 2”
Now, if you observe the formula, you’ll see that how complicate the formula gets, if you don’t build your primrary measures. If you compare the formula with mine you’ll be saved from writing 3 additional lines everytime because I’ve already mentioned this repeating set of conditions into our primary formula.
I’m also attaching the working of the PBIX file for the reference. And I’ve also created a separate measure folder which covers the formulas that I’ve created.
Hoping you find this useful and meets your requirements that you’ve been looking for.
Thanks and Warm Regards,
Harsh
MaskedData - Harsh - Final Output.pbix (1.2 MB)