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
Estoy tratando de calcular para hacer el cálculo del producto en cada fila, pero solo puedo obtener que se calcule desde el principio del conjunto de datos en lugar de calcular en función de la fecha de segmentación de datos. Como se puede ver en la primera imagen y la segunda imagen. En la segunda imagen después de aplicar la segmentación de datos, debe empezar a calcular desde el principio de nuevo y el resultado acumulado debe ser 94,8%.
Gracias por su ayuda.
Solved! Go to Solution.
Hola @dannytango ,
Según mi opinión, desea calcular elccumula de medida dinámicamente basado en Slicer, ¿verdad?
Puede seguir estos pasos:
1. Cree una nueva tabla con Fecha para la segmentación.
2. Utilice la siguiente fórmula:
test =
VAR _min =
MIN ( 'forSlicer'[Date] )
VAR _max =
MAX ( 'forSlicer'[Date] )
RETURN
CALCULATE (
PRODUCTX ( TCMMonthlyReturnsInput, TCMMonthlyReturnsInput[MRTCM] + 1 ),
FILTER (
TCMMonthlyReturnsInput,
'TCMMonthlyReturnsInput'[Date] >= _min
&& 'TCMMonthlyReturnsInput'[Date] <= MAX ( 'TCMMonthlyReturnsInput'[Date] )
)
) - 1
3. Aplique la medida a continuación al panel de filtro (conjunto n.o 1)
Measure =
VAR _min =
MIN ( 'forSlicer'[Date] )
VAR _max =
MAX ( 'forSlicer'[Date] )
RETURN
IF (
MAX ( 'TCMMonthlyReturnsInput'[Date] ) >= _min
&& MAX ( 'TCMMonthlyReturnsInput'[Date] ) <= _max,
1,
0
)
4. Calcule el valor acumulado:
Final Accumulate test =
CALCULATE (
SUMX ( 'TCMMonthlyReturnsInput', [test] ),
FILTER (
ALL ( 'TCMMonthlyReturnsInput' ),
'TCMMonthlyReturnsInput'[Date] <= MAX ( 'TCMMonthlyReturnsInput'[Date] )
&& [Measure] = 1
)
)
Mi visualización tiene este aspecto:
¿He respondido a tu pregunta? Por favor, marque mi respuesta como solución. Muchas gracias.
Si no es así, cargue algunas muestras de datos insensibles y la salida esperada.
Saludos
Eyelyn Qin
Hola @dannytango ,
Según mi opinión, desea calcular elccumula de medida dinámicamente basado en Slicer, ¿verdad?
Puede seguir estos pasos:
1. Cree una nueva tabla con Fecha para la segmentación.
2. Utilice la siguiente fórmula:
test =
VAR _min =
MIN ( 'forSlicer'[Date] )
VAR _max =
MAX ( 'forSlicer'[Date] )
RETURN
CALCULATE (
PRODUCTX ( TCMMonthlyReturnsInput, TCMMonthlyReturnsInput[MRTCM] + 1 ),
FILTER (
TCMMonthlyReturnsInput,
'TCMMonthlyReturnsInput'[Date] >= _min
&& 'TCMMonthlyReturnsInput'[Date] <= MAX ( 'TCMMonthlyReturnsInput'[Date] )
)
) - 1
3. Aplique la medida a continuación al panel de filtro (conjunto n.o 1)
Measure =
VAR _min =
MIN ( 'forSlicer'[Date] )
VAR _max =
MAX ( 'forSlicer'[Date] )
RETURN
IF (
MAX ( 'TCMMonthlyReturnsInput'[Date] ) >= _min
&& MAX ( 'TCMMonthlyReturnsInput'[Date] ) <= _max,
1,
0
)
4. Calcule el valor acumulado:
Final Accumulate test =
CALCULATE (
SUMX ( 'TCMMonthlyReturnsInput', [test] ),
FILTER (
ALL ( 'TCMMonthlyReturnsInput' ),
'TCMMonthlyReturnsInput'[Date] <= MAX ( 'TCMMonthlyReturnsInput'[Date] )
&& [Measure] = 1
)
)
Mi visualización tiene este aspecto:
¿He respondido a tu pregunta? Por favor, marque mi respuesta como solución. Muchas gracias.
Si no es así, cargue algunas muestras de datos insensibles y la salida esperada.
Saludos
Eyelyn Qin
El código devolvió el total del cálculo correctamente, pero no calcula para cada fila. No se pudo cargar el archivo pbix, así que tengo que poner pegarlo en la tabla de abajo. Gracias.
Fecha | MRTCM |
1/31/2017 | 0.66% |
2/28/2017 | 0.21% |
3/31/2017 | 0.96% |
4/30/2017 | 0.66% |
5/31/2017 | 5.21% |
6/30/2017 | 4.20% |
7/31/2017 | 9.14% |
8/31/2017 | 8.62% |
9/30/2017 | 3.12% |
10/31/2017 | 14.91% |
11/30/2017 | 3.09% |
12/31/2017 | -0.26% |
1/31/2018 | 11.04% |
2/28/2018 | 4.16% |
3/31/2018 | -7.44% |
4/30/2018 | -2.48% |
5/31/2018 | 24.14% |
6/30/2018 | 0.99% |
7/31/2018 | -0.97% |
8/31/2018 | 8.98% |
9/30/2018 | 0.84% |
10/31/2018 | -16.97% |
11/30/2018 | -7.69% |
12/31/2018 | -31.07% |
1/31/2019 | 23.02% |
2/28/2019 | 0.24% |
3/31/2019 | 8.83% |
4/30/2019 | 10.56% |
5/31/2019 | -23.15% |
6/30/2019 | 29.09% |
7/31/2019 | 10.17% |
8/31/2019 | -7.13% |
9/30/2019 | 2.98% |
10/31/2019 | 8.71% |
11/30/2019 | 3.65% |
12/31/2019 | 3.76% |
1/31/2020 | 7.39% |
2/29/2020 | 0.98% |
3/31/2020 | -3.48% |
4/30/2020 | 24.12% |
5/31/2020 | 8.34% |
6/30/2020 | 7.90% |
7/31/2020 | 6.49% |
8/31/2020 | 3.00% |
9/30/2020 | 0.01% |
Gracias, @AllisonKennedy
Lo siento, pero soy bastante nuevo en DAX, así que no creo que haya aplicado tu consejo correctamente. Este es mi intento siguiendo su consejo:
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 | |
2 | |
1 |