Forum Discussion
CasperSV
4 years agoHelper II
Dynamic table based on filter
Hi everyone, I am trying to make a Profit and Loss statement in which I want to see what the total amount is till a filtered period. A quick and simple example: If november i...
- 4 years ago
I think you are looking for a 'life to date' calculation. Try somehting like below. You will need a date dimension to make this work.
CALCULATE ( SUM(GLTable[GLAmount]), FILTER ( ALL ( Date[Datekey] ), Date[Datekey] < MAX ( ( Date[Datekey] ) ) ) ) - 4 years ago
Add a year filter.
Like:
measure = CALCULATE ( SUM ( GLTable[GLAmount] ), FILTER ( ALL ( Date[Datekey] ), Date[Datekey] < MAX ( ( Date[Datekey] ) ) && YEAR ( Date[Datekey] ) = SELECTEDVALUE ( Date[Datekey] ) ) )Best Regards,Community Support Team _ Janey
CasperSV
4 years agoHelper II
Sorry for the inconvenience, I have tried this calculation again with a new independent Calendar and it worked :).
One last thing, it should reset when entering a new fiscal year. When I select january 2022, it calculates the sum of 2021. Any idea?
Best regards,
Casper
v-janeyg-msft
4 years agoCommunity Support
Add a year filter.
Like:
measure =
CALCULATE (
SUM ( GLTable[GLAmount] ),
FILTER (
ALL ( Date[Datekey] ),
Date[Datekey] < MAX ( ( Date[Datekey] ) )
&& YEAR ( Date[Datekey] ) = SELECTEDVALUE ( Date[Datekey] )
)
)
Best Regards,
Community Support Team _ Janey