Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi I have two tables, one is a date table, another one is a sales table. These two tables are connected through Order Date (Sales table) to Date (Date table)
I have a measure as below, which gives me the value of fiscal year 2019 total sales $.
This Year Sales = calculate(sum('Sales Table'[Sales $]),filter(Date Table,Date Table[Date] <= Date Table[Fiscal Year 2019 End Date] && Date Table[Date] >= Date Table[Fiscal Year 2019 Start Date]))
In my design view, when I select a specific date from date table, the above measure will give me the sales $ for that date in 2019.
Now I would like also have another measure to give me the sales $ for (same date -364) in 2018.
For example, when select 1/1/2019, this year sales measure gives me the sales $ on 1/1/2019, and I would like to see the sales $ on (1/1/2019 -364) = 1/2/2018 from the new measure.
I have tried to use DAX with sameperiodlastyear, which this one gives me the value for 1/1/2018 instead of 1/2/2018. I think this sameperiodlastyear calculation is based on date minus 365, but I would make it as date minus 364.
Thanks in advance!!
Solved! Go to Solution.
@Anonymous ,
You may try DATEADD() function instead:
DATEADD(<dates>,<number_of_intervals>,<interval>)
https://docs.microsoft.com/en-us/dax/dateadd-function-dax
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
You may try DATEADD() function instead:
DATEADD(<dates>,<number_of_intervals>,<interval>)
https://docs.microsoft.com/en-us/dax/dateadd-function-dax
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
98 | |
90 | |
78 | |
71 | |
64 |
User | Count |
---|---|
112 | |
96 | |
95 | |
67 | |
65 |