Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rohanjaiswal
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
lbendlin
Super User
Super User

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())

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.