Forum Discussion

msksenthil's avatar
msksenthil
Helper III
5 years ago
Solved

SELECTEDVALUE in row context

hello, the SELECTEDVALUE is not showing the selected value from the SLICER in the table visual.

 

I would like to show the values of the selected Quarter and the previous quarter values.

 

Thanks in advance 

 

 

  • msksenthil , it should work unless columns are from disconnected tables

     

    try like maxx(allselected(calendar),calendar[inserted Quarter])

  • Hi msksenthil 

    Try this.

    Create the measure:

    Chart Filter =
    VAR _maxdate =
        CALCULATE (
            MAX ( 'Table'[MMMYY] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[InsertedQuarter] = SELECTEDVALUE ( 'Table 2'[InsertedQuarter] )
            )
        )
    RETURN
        IF (
            SELECTEDVALUE ( 'Table'[MMMYY] ) <= _maxdate,
            SELECTEDVALUE ( 'Table'[InsertedQuarter] ),
            BLANK ()
        )

    Result:

     

    Please check the sample file I attached below.

     

    Best Regards,

    Community Support Team _ Tang

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

5 Replies

  • msksenthil , it should work unless columns are from disconnected tables

     

    try like maxx(allselected(calendar),calendar[inserted Quarter])

  • Nope, it's not working and I tried with disconnected tables also. 😞

    • amitchandak's avatar
      amitchandak
      Super User

      msksenthil ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi msksenthil 

    Try this.

    Create the measure:

    Chart Filter =
    VAR _maxdate =
        CALCULATE (
            MAX ( 'Table'[MMMYY] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[InsertedQuarter] = SELECTEDVALUE ( 'Table 2'[InsertedQuarter] )
            )
        )
    RETURN
        IF (
            SELECTEDVALUE ( 'Table'[MMMYY] ) <= _maxdate,
            SELECTEDVALUE ( 'Table'[InsertedQuarter] ),
            BLANK ()
        )

    Result:

     

    Please check the sample file I attached below.

     

    Best Regards,

    Community Support Team _ Tang

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