Forum Discussion

narjissio's avatar
narjissio
New Member
2 years ago

SELECTEDVALUE(TableDate[Date])

Hello, need your help, I want to retrieve the value selected in a filter context to use it in comparison in a table of fact, I did the test to display SELECTEDVALUE(TableDate[Date]) in a new column, it returns me only empty, however if I use the same code in a measure, and I display the measure in a visual it returns me well the selected date.

3 Replies

    • narjissio's avatar
      narjissio
      New Member

      Thanks PijushRoy,
      I tried this code in a new column DisplayDate = SELECTEDVALUE(TableDate[Date], "No Single Selection"), returned me Error "Expressions that return a variant data type cannot be used to define calculated columns", then I tried the following code DisplayDate = SELECTEDVALUE(TableDate[Date], 2023-08-15) and it returned the date 1905-06-22, and that's not the right result either, given that I selected the date 2023-08-15 in the filter (date segment)

  • PijushRoy's avatar
    PijushRoy
    Community Champion

    Hi narjissio 

    Create a measure, not calculated column, then use the measure for your visual
    Hope that helps

    If solved your requirement, please mark this answer as SOLUTION.
    If this comment helps you, appreciate your KUDOS