Forum Discussion
Comparing current vs last year sales - multiple date columns
- Anonymous6 years ago
Hi Anonymous ,
Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous .
My desired output is a table, so I'm getting a fixed value for the L_Y measure for each month.
The table is able to show
Count 2020= CALCULATE(sum(table[count]),table[sales date]>=date(2020,1,1),table[sales date]<=date(2020,12,31))
values in the output table, for January to December of this year
Thanks
Hi Anonymous ,
Check if the visual below is what you want.
C_Y = CALCULATE(SUM('Table'[count]),FILTER(ALLEXCEPT('Table','Table'[sales date month]),'Table'[as of date] in VALUES('Table'[as of date])))
L_Y = CALCULATE(SUM('Table'[count]),FILTER(ALLEXCEPT('Table','Table'[sales date month]),EDATE('Table'[as of date],12) in VALUES('Table'[as of date])))
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hi Anonymous.
The measures didn't worked for me.
Can you please share your pbix file?
Thank you!
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hello Anonymous and Greg_Deckler
The following worked for me, modifying the code you provided:
Measure 1 = CALCULATE(sum(Table[Count]),Table[Date]>=Date(2020,1,1),Table[Date]<=Date(2020,12,31))Measure 2 = CALCULATE(sum(Table[Count]),Table[Date]>=Date(2019,1,1),Table[Date]<=Date(2019,12,31),SAMEPERIODLASTYEAR(Table[Date]))Thank you so much for your help!