March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi I am sorry I can not give upload my pbix file but I will try to be as clear as possible.
So I have a fact table that contains many versions of a single between 2013-2020 and a date table that also contains many versions of a single year (I tried just having a date table with the 7 specific years, yes that removes the many to many relationship but I can not do DATEADD(Date[Year]) this function does not work. The error given is that DATEADD is not of type DATE).
I am trying to calculate the Total Value of my fact table. Doing a simple sum works and gives me the correct values however when I use
Hi @Anonymous ,
Is the date table a calendar table? if not, I think you need to create a calendar table firstly. The following is my sample using the both functions of DATEADD and SAMEPERIODLASTYEAR you can have a try.
Date = CALENDARAUTO() year = YEAR('Date'[Date].[Date])
SAMEPERIODLASTYEAR = CALCULATE(SUM(Table1[ Sales]),SAMEPERIODLASTYEAR('Date'[Date])) DATEADD = CALCULATE(SUM(Table1[ Sales]),DATEADD('Date'[Date],-1,YEAR))
Note: If you choose 2015 to 2017, then it will be calculated the values of last year of the selected date. So the values of 2017 will not be showed.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
57 | |
52 |
User | Count |
---|---|
197 | |
133 | |
107 | |
69 | |
65 |