I tried to do a filter to only display 2 lines with totals but the total lines are not showing correctly. Total should be zero. It is showing total of lines even if those lines are hidden. Can this be fixed? Please see screenshot below :
Filter does not affect the aggregation. It is just for displaying the list items.
In this case you need another line item that shows the value at the low level only if it meets your filter criteria and then aggregate that to top levels.
@Ana22 this is a great question - one that I've encountered several times.
Firstly, @ArunManickam's suggestion is a good one. You can try that.
You can also use the "select levels" if the summary level is the same as the two lines you're looking for.
Anothter easy way to filter the levels you want is to create a system module for the dimension that contains the summary level (not the lowest level). Then set that filter on your module.
Lastly, you can set a filter for just the levels you want but it's a little more complicated.
You can see how to set a formula at any level of the hierarchy in this answer I wrote - scroll to the very bottom. You can the set your filter on that level.
If any of these suggestions look promising let me know, I'll create an example for you.
And additionally to @ArunManickam suggestion, might also be worth having it as a separate module, that way the source information isn't impacted with any unintended consequences mitigated.
What you can also do is on the filter module have a line item that brings back the name of the filter and can then use either SUM or LOOKUP in the output module depending on whether or not you want to see the granular detail.
The following might help: https://community.anaplan.com/t5/Anaplan-Platform/SUM-function-based-on-User-specific-filter/m-p/58852#M10147