cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ax80
New 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.

 

My current formula is this:

Amount =
CALCULATE(SUM(Table[Amount]);
USERELATIONSHIP('Date'[Date];Table[Document date]))
 

Any suggestion?

Thanls

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@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]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
amitchandak
Super User IV
Super User IV

@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]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors