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
Community Blog

Community Blog

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

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors