Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

set a default value on a slicer

Hello,   From reading im pretty sure the answer to this is "no". But some of the questions re this are dated, so Im hoping we have moved forward since.   I have a slicer for Fiscal period. ...
  • v-yulgu-msft's avatar
    8 years ago

    Hi Anonymous,

     

    In my test, I created a DimDate table which has no relationship with actual data table. In DimDate table, create a Month column which will be added to slicer later.

     

    Then, apply filter to measures. Suppose the original measure is like:

    Invoiced to date = SUM('Fiscal Sales'[Amount])

     

    Please adjust it to:

    Invoiced to date =
    IF (
        HASONEFILTER ( DimDate[Month] ),
        CALCULATE (
            SUM ( 'Fiscal Sales'[Amount] ),
            FILTER (
                'Fiscal Sales',
                'Fiscal Sales'[Date].[MonthNo] = MAX ( DimDate[Month] )
            )
        ),
        CALCULATE (
            SUM ( 'Fiscal Sales'[Amount] ),
            FILTER ( 'Fiscal Sales', 'Fiscal Sales'[Date].[MonthNo] = MONTH ( TODAY () ) )
        )
    )

     

    Best regards,
    Yuliana Gu