Forum Discussion
Parameter Year in Virtual Table
Hello everybody
I have a table with some values to display in a Segmentor and another table with some objective values.
Depending on the selected year, only the values that appear in the T_Objective will be shown and if there is no record for that year, all the records of the T_DiasCierre are shown.
That seems to more or less work for me.
I have the problem when trying to retrieve the value of the year (SELECTEDVALUE(Calendar[Date].[Year])) that does not retrieve any value.
finalCalc =
var anno = SELECTEDVALUE(Calendario[Date].[Año])
VAR _Filtered =
CALCULATE(SUM(T_Objetivo[VALOR]),T_Objetivo[AÑO] = anno && T_Objetivo[AMBITO] = "USER" && T_Objetivo[INDICADOR] = "CLOSED" )
VAR calculo =
ADDCOLUMNS (
GROUPBY (
T_U_DiasCierre,
T_U_DiasCierre[Id],
"Valor", SUMX ( CURRENTGROUP (), [Valor] )
),
"Activo", IF(ISBLANK( _Filtered), 1,IF ( [Valor] = _Filtered, 1 ))
,"ANNO", SELECTEDVALUE(Calendario[Date].[Año])
,"a_calen",anno
)
return calculo
What can I do to solve this problem ?
I will appreciate your help
Thanks
4 Replies
- GCM_9Regular Visitor
I have a filter with the different years that we can select.
The year that we select is the one that I want to pass as a filter parameter
I'm trying to get it back SELECTEDVALUE(Calendario[Date].[Año]) but this not retrieve any value
Also tried with SELECTEDVALUE(Calendario[Date].[Año],MAX(CALENDARIO[año])) with the same result (NULL)