Forum Discussion

rsbin's avatar
rsbin
Community Champion
4 years ago

Create Drill Through table from SWITCH Measure

Hello,

I have begun using the Switch function in conjunction with Slicers to create some bar chart visuals.  Given the following Measure:

 

MissingPunchCount_Unpivot_Switch = SWITCH(
                                        TRUE(),
                                        [Selected_MissingPunchPeriod] = "Yesterday", [MissingPunchCount_Unpivot_Yesterday],
                                        [Selected_MissingPunchPeriod] = "Current Pay Period", 
                                            CALCULATE( [MissingPunchCount_Unpivot], 
                                                            vw_RPT_MissedPunches_ALL__DALY[PayPeriod] = "Current" ),
                                        [Selected_MissingPunchPeriod] = "Previous Pay Period",
                                            CALCULATE( [MissingPunchCount_Unpivot], 
                                                            vw_RPT_MissedPunches_ALL__DALY[PayPeriod] = "Previous" ))

 

In a Slicer, User can select from 3 time periods - Yesterday, Current Pay Period, and Previous Pay Period. 
Example of bar chart for "Yesterday" follows where the blurred out y-axis is Facility:

 

This is all fine and good.  Now I provide the User with a Drill Through button to navigate to a Details page containing a Table Visual at the Facility Level. 

However, this table is capturing all Rows for the Facility , and does not consider the time period selected.
The issue I believe is the Drill Through does not recognize the various filters being used in my Switch Statement above.

Hoping someone can provide some assistance or guidance as to how best to filter the Drill Through table to capture only the relevant rows derived from the Switch Statement. 

 

As always thanks in advance and kind regards,  

4 Replies