How to capture the selected value of a slicer in a formula?

Occasional Contributor

I need to capture the selected value of a slicer like ID or Date. In browsing the Slicer Settings, there a defined name for the Slicer and stated that its can be used in a formula. I tried to in insert in a cell =INDERECT formula or simply =defined name but none did work. 

Is there a way to get the value of selected slicer?

 

Thamer_Tarabzouni_0-1665459194896.png

 

2 Replies

@Thamer_Tarabzouni The attached article clearly demonstrates how to do just that. And at the end it also explains the real meaning of the bit "Name to use in formulas:"

https://www.myonlinetraininghub.com/use-excel-slicer-selection-in-formulas 

@Thamer_Tarabzouni 

Alternatively if you run Excel > 2010 on Windows, load your SourceTable to the Data Model (Power Pivot):

 

_Screenshot.png

 

in I11 (returns the 1st item selected in Slicer_Name

=CUBERANKEDMEMBER("ThisWorkbookDataModel",
    CUBESET("ThisWorkbookDataModel", Slicer_Name),
    1
)

 Corresponding sample attached