Forum Discussion
sum with two filters dates
I have a TabelDate table [xt_date] that is linked to another PRODTABEL table,
I have two columns from the PRODTABEL table that are linked to the TabelDate [xt_date] table, PROTABEL [DATA_A] AND PRODTABEL [DATA_B].
The relationship that is active is the TabelDate [xt_date] ---> PROTABEL [DATA_A] relationship.
The PRODTABEL table has a third column that is PRODTABEL [VALUE]
.
I want to show on a card the sum of the value, for yesterday's date TabelDate [xt_date] ---> PROTABEL [DATA_B] (inactive relation). But that the sum that appears on the card is that the date TabelDate [xt_date], PROTABEL [DATA_A] is more than 12 months and less than 24 months.
Can anyone help me ? I apologize for not using the example image, but there is a sensitive date.
Anonymous , did not get it completely
Something like this
Rolling 12 till last 24 month = CALCULATE(sum(PROTABEL [VALUE]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(PROTABEL [DATA_A],-12,month)),-12,MONTH),PROTABEL[DATA_B] =Today()-1)
2 Replies
- amitchandak
Super User
Anonymous , did not get it completely
Something like this
Rolling 12 till last 24 month = CALCULATE(sum(PROTABEL [VALUE]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(PROTABEL [DATA_A],-12,month)),-12,MONTH),PROTABEL[DATA_B] =Today()-1)
- vanessafvg
Community Champion
can you provide dummy data as an example as i am not sure i fully understand what you asking.
from what i can tell you will need to use the userelationship function with a dateadd function with the yesterdays date.
https://docs.microsoft.com/en-us/dax/userelationship-function-dax