Forum Discussion

MWare's avatar
MWare
Helper I
4 years ago
Solved

Help with SELECTEDVALUE

I'm trying to return data in the 'HELP' table so that when the 'Reporting View' slicer is: Day Selected - the table returns data for the date selected in the 'Date' slicer only PTD - the table retu...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi MWare ,

    According to your description, I download your pbix. Here's my solution, modify the formula like this:

    Measure PTD =
    VAR p =
        MAXX (
            FILTER (
                ALL ( Date_Period_Table ),
                Date_Period_Table[Date] = SELECTEDVALUE ( 'Date'[Date] )
            ),
            Date_Period_Table[Period]
        )
    RETURN
        IF (
            SELECTEDVALUE ( Date_Period_Table[Period] ) = p
                && SELECTEDVALUE ( Date_Period_Table[Date] ) <= SELECTEDVALUE ( 'Date'[Date] ),
            "PTD"
        )
    

    Get the expected result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.