Forum Discussion
Randcharles
Helper I
2 years agoMy Date column cannot be retrieved from SELECTEDVALUE
Hi all, I am facing on a new issue when I want to retrieve the Date from my table Dim_Date using SELECTEDVALUE(). Indeed, when I display the result of my SELECTEDVALUE() from my Date (Quot...
- Anonymous2 years ago
Hi Randcharles ,
As checked your screenshot, the measure [#Test] will return option values for different fields depending on the value of variable _Periodicite, and it appears that the data type of the measure is counted as General. However, you need to return a value that contains multiple types: a date (Dim_Date[Quotidien]), a numeric value and possibly a Text type.
You can update the formula of measure [#Test] as below to get the expected result...
#Test = VAR _Periodicite = MAXX ( 'Param_Periodicite', 'Param_Periodicite'[Periodicite Order] = SELECTEDVALUE ( 'Param_Periodicite'[Periodicite Order] ), 'Param_Periodicite'[Periodicite] ) RETURN SWITCH ( TRUE (), _Periodicite = "Mensuel", SELECTEDVALUE ( Dim_Date[Mensuel] ), _Periodicite = "Hebdo", SELECTEDVALUE ( Dim_Date[Hebdo] ), _Periodicite = "Quotidien", FORMAT ( SELECTEDVALUE ( Dim_Date[Quotidien] ), "MM/DD/YYYY" ) )Best Regards
LeandroDeodato
Resolver II
2 years agowork well to me. i use the same date field in mensure and slicer
chosen date = SELECTEDVALUE(DIM_CALENDARIO[Data])
confirm the type of mensure field, ajust to shortdate