Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola a todos,
Tengo esta medida que calcula YTD Real (-2 meses) + Presupuesto de meses restantes.
Cuando utilizo lo siguiente con "Calcular (SUM))" todo funciona perfectamente:
Solved! Go to Solution.
Prueba esto. Cada medida necesita un CALCULATE.
Act + Bdgt_GP_Bef_Com =
VAR _max1 =
MAXX ( ALLSELECTED ( Dates ), Dates[Date_2] )
VAR _max =
EOMONTH ( DATE ( YEAR ( _max1 ), MONTH ( _max1 ) - 2, 1 ), 0 )
VAR _min =
DATE ( YEAR ( _max1 ), 1, 1 )
VAR _minb =
DATE ( YEAR ( _max1 ), MONTH ( _max1 ) - 2, 1 )
VAR _maxb =
DATE ( YEAR ( _max1 ), 12, 31 )
RETURN
CALCULATE (
[YTD_GP_Before_Com],
FILTER ( Dates, Dates[Date_2] <= _max && Dates[Date_2] >= - _min )
)
+ CALCULATE (
[YTD_Bdgt_GP_Before_Com], FILTER(Dates, Dates[Date_2] <= _maxb
&& Dates[Date_2] >= _minb
)
Proud to be a Super User!
Necesita la función CALCULATE:
Act + Bdgt_GP_Bef_Com =
VAR _max1 =
MAXX ( ALLSELECTED ( Dates ), Dates[Date_2] )
VAR _max =
EOMONTH ( DATE ( YEAR ( _max1 ), MONTH ( _max1 ) - 2, 1 ), 0 )
VAR _min =
DATE ( YEAR ( _max1 ), 1, 1 )
VAR _minb =
DATE ( YEAR ( _max1 ), MONTH ( _max1 ) - 2, 1 )
VAR _maxb =
DATE ( YEAR ( _max1 ), 12, 31 )
RETURN
CALCULATE (
[YTD_GP_Before_Com],
FILTER ( Dates, Dates[Date_2] <= _max && Dates[Date_2] >= - _min ) + [YTD_Bdgt_GP_Before_Com]], FILTER(Dates, Dates[Date_2] <= _maxb
&& Dates[Date_2] >= _minb
)
Proud to be a Super User!
@DataInsights muchas gracias por tu respuesta.
La función parece funcionar sin embargo, dice que ahora "Una función 'FILTER' se ha utilizado en una expresión True/False que se utiliza como una expresión de filtro de tabla. Esto no está permitido."
¿Alguna idea de lo que podría causar esto?
Muchas gracias por tu ayuda,
Nick
Prueba esto. Cada medida necesita un CALCULATE.
Act + Bdgt_GP_Bef_Com =
VAR _max1 =
MAXX ( ALLSELECTED ( Dates ), Dates[Date_2] )
VAR _max =
EOMONTH ( DATE ( YEAR ( _max1 ), MONTH ( _max1 ) - 2, 1 ), 0 )
VAR _min =
DATE ( YEAR ( _max1 ), 1, 1 )
VAR _minb =
DATE ( YEAR ( _max1 ), MONTH ( _max1 ) - 2, 1 )
VAR _maxb =
DATE ( YEAR ( _max1 ), 12, 31 )
RETURN
CALCULATE (
[YTD_GP_Before_Com],
FILTER ( Dates, Dates[Date_2] <= _max && Dates[Date_2] >= - _min )
)
+ CALCULATE (
[YTD_Bdgt_GP_Before_Com], FILTER(Dates, Dates[Date_2] <= _maxb
&& Dates[Date_2] >= _minb
)
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |