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

Filter to date selected on slicer

Hello all, I want to count leads that were created from beginning of the month till date I selected on slicer.
I have filtered whole page to current month. I have measure like this:
 
m_Lead =
VAR selected_date = SELECTEDVALUE('CalendarAuto'[Date])
RETURN
CALCULATE(
COUNT('Lead'[LeadId]);
FILTER('CalendarAuto';'CalendarAuto'[Date] <= selected_date
))
It doesnt return any values. When I replace " <= selected_date " with e.g " datevalue("10/08") " it shows data I want.
Please tell me what do I need to do?
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Filter to date selected on slicer

Oki my collegue found solution, I just needed to add extra limit on data to the month + another calculate. Now everything counts as it should. Anyway thanks for your help!

 

m_Lead =
VAR selected_date = SELECTEDVALUE('CalendarAuto'[Date])
RETURN
CALCULATE(
CALCULATE( COUNT('Lead'[LeadId]);
'CalendarAuto'[Date] <= selected_date && 'CalendarAuto'[Date] >= DATE(YEAR(selected_date);MONTH(selected_date);1)

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: Filter to date selected on slicer

Hi, what kind of slicer are you using for dates? 

SELECTEDVALUE will return data only if you are just selecting ONE value. If there are more than one it won't return values. You can try MAX or MIN for the date if you are using a range o selecting more than one.

 

Regards, hope this helps

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog


Highlighted
Frequent Visitor

Re: Filter to date selected on slicer

I am using regular slicer. I have single option ON.

 

When I put jus SELECTEDVALUE into measure and click on various dates then values are changing.

 

 

Highlighted
Super User II
Super User II

Re: Filter to date selected on slicer

Can you upload a picture of the slicer visualization and the return value of a measure containing SELECTEDVALUES ( Table[Date] )???



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog


Highlighted
Frequent Visitor

Re: Filter to date selected on slicer

Oki my collegue found solution, I just needed to add extra limit on data to the month + another calculate. Now everything counts as it should. Anyway thanks for your help!

 

m_Lead =
VAR selected_date = SELECTEDVALUE('CalendarAuto'[Date])
RETURN
CALCULATE(
CALCULATE( COUNT('Lead'[LeadId]);
'CalendarAuto'[Date] <= selected_date && 'CalendarAuto'[Date] >= DATE(YEAR(selected_date);MONTH(selected_date);1)

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors