Forum Discussion
ax80
5 years agoNew Member
USERELATIONSHIP WITH PREVIOUS YEAR DATE
Hi all, I'm using USERELATIONSHIP in a formula with dates and I need to substitute year of selected dates with previous year. Dates are used a slicer on the page with yerarchy Year/Quarter/Month. ...
- 5 years ago
ax80 , Try like. Keep USERELATIONSHIP inside
CALCULATE( CALCULATE(SUM(Table[Amount]);
USERELATIONSHIP('Date'[Date];Table[Document date])) ,DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))or
CALCULATE(CALCULATE(SUM(Table[Amount]);
USERELATIONSHIP('Date'[Date];Table[Document date])),previousyear('Date'[Date]))
amitchandak
5 years agoSuper User
ax80 , Try like. Keep USERELATIONSHIP inside
CALCULATE( CALCULATE(SUM(Table[Amount]);
USERELATIONSHIP('Date'[Date];Table[Document date])) ,DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
or
CALCULATE(CALCULATE(SUM(Table[Amount]);
USERELATIONSHIP('Date'[Date];Table[Document date])),previousyear('Date'[Date]))