Forum Discussion
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
- PijushRoyCommunity Champion
Hi narjissio
In measure, it will return one single value, or the alternative result is nothing selected.
Hope this will help you
Find more - https://learn.microsoft.com/en-us/dax/selectedvalue-function
If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS- narjissioNew 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)