Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Buenas tardes, estoy con un problema para generar una medida en Power BI. Desde ya muchas gracias por cualquier ayuda o sugerencia que tengan.
Tengo configurada una columna calculada que obtiene el mes actual y los 12 meses siguentes según el filtro seleccionado:
Si selecciono otro mes
Este es el resultado.
Esto es correcto es lo que espero, pero además de esto necesito que me grafique del periodo seleccionado los ultimos 5 años.
es decir:
El acumulado desde agos2021 a sep2022, agos2022 a sep2023, etc, pero aun no eh logrado obtener este resultado por más que intente reiteradas veces.
Quizas el problema este en como calcule el "Año fiscal" pero si o si lo necesito en columna debido a que Power BI no permite poner una medida en un eje X de un grafico.
¿Alguna idea de como resolver esto?
Solved! Go to Solution.
I'm afraid your requirement cannot be achieved directly. If you want to display the data of the previous five years of the selected date in the visualization, please refer to the following test.
My sample data is from 2022 to the present, and the formula I wrote calculates the data for the past year of the selected date.
Measure:
MEASURE =
IF (
DATE ( YEAR ( MAX ( [Date] ) ), MONTH ( MAX ( [Date] ) ), DAY ( MAX ( [Date] ) ) )
>= DATE ( YEAR ( SELECTEDVALUE ( slicer[Date] ) ) - 1, MONTH ( SELECTEDVALUE ( slicer[Date] ) ), DAY ( SELECTEDVALUE ( slicer[Date] ) ) ),
1,
0
)
Put the measure into the visual-level filters, set up show items when the value is 1.
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm afraid your requirement cannot be achieved directly. If you want to display the data of the previous five years of the selected date in the visualization, please refer to the following test.
My sample data is from 2022 to the present, and the formula I wrote calculates the data for the past year of the selected date.
Measure:
MEASURE =
IF (
DATE ( YEAR ( MAX ( [Date] ) ), MONTH ( MAX ( [Date] ) ), DAY ( MAX ( [Date] ) ) )
>= DATE ( YEAR ( SELECTEDVALUE ( slicer[Date] ) ) - 1, MONTH ( SELECTEDVALUE ( slicer[Date] ) ), DAY ( SELECTEDVALUE ( slicer[Date] ) ) ),
1,
0
)
Put the measure into the visual-level filters, set up show items when the value is 1.
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 48 | |
| 35 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 134 | |
| 110 | |
| 59 | |
| 39 | |
| 32 |