cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
thatguyagain Visitor
Visitor

Comparing Slicer date and column date

Hi

I want to use a date slicer, which returns one date, to calculate the number of days between each transaction date and the selected slicer date, this to accomodate for an option to show a customer aging report as it was on a given date.

 

My issue is that this works 100%:

 

Daysbetween = date(2019;6;30)-'Date'[Date]

While this doesnt work

 

 

SelectedDate = SELECTEDVALUE(PerDateTable[PerDate])
DaysbetweenMeasureinput = [SelectedDate]-'Date'[Date]

event though I know [SelectedDate] returns the same date 30.06.2019

 

I understand this has to do with context, but is there any way to achieve this?

 

Any pointers are appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Comparing Slicer date and column date

Hi @thatguyagain 

 

Take a try of this one: 

Measure = MAXX('Date',DATEDIFF([Date],SELECTEDVALUE(PerDateTable[PerDate]),DAY))

2.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
Super User IV
Super User IV

Re: Comparing Slicer date and column date

Hi @thatguyagain 

 

You can create a measure to calculate this, something like below.

 

DaysbetweenMeasureinput = 
SUMX( Dates, SELECTEDVALUE( DatePicker[Date] ) - Dates[Date] ) * 1

See the attached file for reference.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski


 

Community Support Team
Community Support Team

Re: Comparing Slicer date and column date

Hi @thatguyagain 

 

Take a try of this one: 

Measure = MAXX('Date',DATEDIFF([Date],SELECTEDVALUE(PerDateTable[PerDate]),DAY))

2.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors