Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I'm trying to create a measure that returns my sales from the parallel period LY to this exact date.
i.e : if today is the 09/05/24 I would like to retrieve sales from 01/01/23 to 09/05/23.
And compare that with the parallel period this year.
These are the measures I use:
Solved! Go to Solution.
Hi,
Thanks for your reply.
The LY YTD is solved....
For some reason the YTD stops on April and doesn't show the May sales.
This is the code I wrote:
@Sivadster share your sample dataset, and try to create correct connection between Calendar Table and your data table, i.e make sure column type should be DATE for both related columns
@Sivadster You can achieve this by using the following measure, you need to create a Calendar Table:
Date Table = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
Sales LYTD =
TOTALYTD(SUM('Table'[Sales]),
DATEADD('Date Table'[Date],-1,YEAR))
Sales YTD =
TOTALYTD(SUM('Table'[Sales]), 'Date Table'[Date])
Power BI File:
Regards,
Fahad Qadir
Did I answer your question? Mark my post as a solution!
Hi,
Thanks for your reply.
The LY YTD is solved....
For some reason the YTD stops on April and doesn't show the May sales.
This is the code I wrote:
@Sivadster share your sample dataset, and try to create correct connection between Calendar Table and your data table, i.e make sure column type should be DATE for both related columns
Hi, found a problem that caused it. Your solution works.
Thanks
User | Count |
---|---|
92 | |
85 | |
76 | |
66 | |
62 |
User | Count |
---|---|
110 | |
96 | |
95 | |
64 | |
57 |