Forum Discussion

gvg's avatar
gvg
Icon for Post Prodigy rankPost Prodigy
9 years ago
Solved

Find previous month selected in slicer

Hi,

 

I have a month filter in a slicer coming from a standard calendar like below. How can I get previous (from the last selected) month number, please? I need to get 02 in this case, as 03 is the last month in the selection. Thanks.

 

 

  • Found a solution:

     

    MonthSelected previous = LEFT(RIGHT(
    	CONCATENATEX(
             ALLSELECTED('Date'[Monthnumber]),
            'Date'[Monthnumber],","
        ),
    	5),2)

    Thanks for the tip at powerpivot(pro).  

1 Reply

  • gvg's avatar
    gvg
    Icon for Post Prodigy rankPost Prodigy

    Found a solution:

     

    MonthSelected previous = LEFT(RIGHT(
    	CONCATENATEX(
             ALLSELECTED('Date'[Monthnumber]),
            'Date'[Monthnumber],","
        ),
    	5),2)

    Thanks for the tip at powerpivot(pro).