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

Need Data on basis of specified period from slicer

We have slicer1  named 'Period' having values Daily / Two Days/Three Days/Weekly/Fortnighlty/Montly/Half Yearly/Yearly

also we have  slicer2 named 'From date' with datetime data type having list of date values.

 

Requirement: 

1. When we select daily from 'period' slicer and date(say '01/08/2018') from slicer2, Our respective line graph should display data for '01/08/2018' only.

2. When we select Two days from 'period' slicer and date(say '01/08/2018') from slicer2, Our respective line graph should display data for '01/08/2018 and 02/08/2018' only.

3.When we select weekly from 'period' slicer and date(say '01/08/2018') from slicer2, Our respective line graph should display data for '01/08/2018 to 07/08/2018' only.

4.When we select Yearly from 'period' slicer and date(say '01/08/2018') from slicer2, Our respective line graph should display data for '01/08/2018 to 31/07/2019' only.

.......likewise

 

How can we achieve this in Power BI desktop

 

 

2 REPLIES 2
Highlighted
Super User V
Super User V

Re: Need Data on basis of specified period from slicer

Your line values need to come from a measure that you construct based on the slicer selection (which you have hopefully set to single select, otherwise your users will try to select both "daily" and "monthly"  and then complain to you that the result makes no sense)

 

The measure will look like so:

 

line value = switch(selectedvalue(slicer),"Daily",(day measure),"Weekly",(week measure),"Monthly",(month measure),...,Blank())

Highlighted
Frequent Visitor

Re: Need Data on basis of specified period from slicer

Thanks....@lbendlin 

 

Can you also help with particular measure either for any of the period week ,day ..else to clculat range starting from selected date in slicer

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors