Forum Discussion
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.
My current formula is this:
Any suggestion?
Thanls
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]))
2 Replies
- amitchandak
Super 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])) - KidataRegular Visitor
Try this:
CALCULATE(CALCULATE(SUM(Table[Amount]);
USERELATIONSHIP('Date'[Date];Table[Document date])),SAMEPERIODLASTYEAR('Date'[Date]))