Create Period Slicer in PowerPivot

slesko

New Member
Joined
Apr 20, 2016
Messages
3
Hi,
I want to create a (WTD, MTD, YTD) slicer. My data structure is simple. I have a date column, Total time column, and Location column. The overall goal is to create a PowerView chart showing the total time by location but the kicker is I also want to be able to select on my three button slicer "WTD, MTD, YTD" to filter the chart. I also have already created a Date table in PowerPivot. I have been playing around with the SWITCH() function but failing miserably. Simply, right. Thanks for all your help.
Steve
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I think that you want a disconnected slicer here.

Setup a small table in Excel, say called ReportType, with Id 1-n, and Type for each of the slicer values. Import that to PowerPivot (don't try to connect to any other table).

Add a measure, like
SelectedOption:= MIN( ReportType[Id] )

Assuming you already have measures such as TotalSales, MTD, QTD, and YTD then your display measure would be something along the lines of

Code:
=IF( VALUES( ReportType[Type] )="MTD", [MTD],   IF( VALUES(  ReportType[Type] )="QTD", [QTD],
   IF( VALUES( ReportType[Type] ) ="YTD", [YTD],
   [TotalSales])))
 
Upvote 0
Thank you for the help but I'm still having an issue. Below is my measure. Thanks

Periods:=IF(VALUES(Period[Period])="WTD",[WeekToDate],IF(VALUES(Period[Period])="MTD",[MonthToDate],IF(VALUES(Period[Period])="YTD",[YearToDate],ALL())))

Below is WeekToDate measure

WeekToDate:=CALCULATE(COUNT(ETR[Outage no]),FILTER(etr,WEEKNUM(ETR[Start Date])=WEEKNUM(TODAY())))

When I created the filter nothing happens to my charts when I select WTD. I did make sure that there is a "start Date" that is in this week.

Thanks,
 
Upvote 0
It's a little difficult to envisage the problem; would it be possible to upload the file somewhere?
 
Upvote 0
Sorry theBardd. I've got basically a Name, StartDate, EndDate. I want to create a slicer in powerview that when I click on MTD button it just shows me the month to date items on my charts. I also have created a Period table which has PeriodId and PeriodName that I do not have linked. The data inside the Period table is PeriodId 1 - PeriodName WTD, and PeriodId 2 - PeriodName MTD, and PeriodId 3 - YTD. I'm hope this helps some. Again. Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,163
Messages
6,176,814
Members
452,744
Latest member
Alleo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top