Forum Discussion
NewbieJono
1 year agoPost Partisan
Same Day previous Year
Hello, I have some Dax to get from the previous year, which seems to work. but for some reason, the total volume is completely wrong, There is a filter of 3 weeks applied to the table Same Day P...
- Anonymous1 year ago
Hi NewbieJono
Thanks for the reply from Greg_Deckler .
The following testing is for your reference.
Sample:
Create two measures as follow
This year = CALCULATE(SUM('FACT -Receipts'[Value]) , FILTER('FACT -Receipts', [Date] >= MIN('DIM - Date Table'[Date]) && [Date] <= MAX('DIM - Date Table'[Date])))Same Day previous Year = CALCULATE ( SUM ( 'FACT -Receipts'[Value] ), FILTER ( 'FACT -Receipts', [Date] >= DATE ( YEAR ( MIN ( 'DIM - Date Table'[Date] ) ) - 1, MONTH ( MIN ( 'DIM - Date Table'[Date] ) ), DAY ( MIN ( 'DIM - Date Table'[Date] ) ) ) && [Date] <= DATE ( YEAR ( MAX ( 'DIM - Date Table'[Date] ) ) - 1, MONTH ( MAX ( 'DIM - Date Table'[Date] ) ), DAY ( MAX ( 'DIM - Date Table'[Date] ) ) ) ) )Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
1 year agoNot applicable
Hi NewbieJono
Thanks for the reply from Greg_Deckler .
The following testing is for your reference.
Sample:
Create two measures as follow
This year = CALCULATE(SUM('FACT -Receipts'[Value]) , FILTER('FACT -Receipts', [Date] >= MIN('DIM - Date Table'[Date]) && [Date] <= MAX('DIM - Date Table'[Date])))
Same Day previous Year =
CALCULATE (
SUM ( 'FACT -Receipts'[Value] ),
FILTER (
'FACT -Receipts',
[Date]
>= DATE ( YEAR ( MIN ( 'DIM - Date Table'[Date] ) ) - 1, MONTH ( MIN ( 'DIM - Date Table'[Date] ) ), DAY ( MIN ( 'DIM - Date Table'[Date] ) ) )
&& [Date]
<= DATE ( YEAR ( MAX ( 'DIM - Date Table'[Date] ) ) - 1, MONTH ( MAX ( 'DIM - Date Table'[Date] ) ), DAY ( MAX ( 'DIM - Date Table'[Date] ) ) )
)
)
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- NewbieJono1 year agoPost Partisan
Hello, it seems to be returning blanks? any ideas?