Forum Discussion
Dynamic table based on filter
- 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
Hi Shahfaisal,
Thanks for the reply.
I am trying the calculation, however something is wrong.
Do you have any idea?
Month = Maand
- Shahfaisal4 years agoSolution Sage
Just use your date key. If posting date is your date key then it needs to be Tabel[Posting date].
- CasperSV4 years agoHelper II
Unfortunately it is not working.
With this formula :
The colums are zero, also when I am filtering on october or november:
I have tried <= MAX ((Tabel[posting date])) as well and results in the following:
When filtering on november:
However, GL amount till last period should be zero for Packaging materials.
And work clothes should be GL amount till last period 200.
- Shahfaisal4 years agoSolution Sage
As I mentioned in my first post, you will need a date dimension for the code to work. From your code, it looks like you are using date from the GL table. Create a date dimension, link the GL table with the date dimension (table) and then modify the DAX code to look like the code I pasted in my first post.