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
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.
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.