Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |