Forum Discussion

Atanas_Atanasov's avatar
2 years ago
Solved

Showing Last Selected Month

Dear All,   I'd like to show the name of the last selected Month And Year when having multiple selections in my slicer. For example if Janunary, February, March, April, May and June are selected I'...
  • Jihwan_Kim's avatar
    2 years ago

    Hi,

    I think, the reason is because of the sort order column is missed in the measure.

    Please try something like below.

    I tried to create a sample pbix file like below.

    please check the below picture and the attached pbix file.

     

     

     

    Selected Period: =
    VAR _maxdate =
        CALCULATE (
            LASTNONBLANK ( dim_calendar[month year sort], [Total orders:] ),
            ALLSELECTED ( dim_calendar )
        )
    RETURN
        SELECTCOLUMNS (
            FILTER ( ALL ( dim_calendar ), dim_calendar[month year sort] = _maxdate ),
            dim_calendar[month year]
        )