Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Crear tabla calculada con valores calculados a partir del valor seleccionado en una visualización.

Buenas tardes.

Os explico el caso, tengo :

 

- Tabla Calendario (DAX)

- Segmentador (Filtro desplegable) del campo "Fecha" de la tabla calendario.

- Segmentador (Filtro desplegable) con el número de registros que quiero visualizar ( 1,2,3... 15)

- Tabla de valores con fechas, nº de semana e importes.

 

Necesito que al seleccionar una fecha, me tome su valor y le descuente tantas semanas como número aparezca en el segmentador, por ejemplo...  Fecha Seleccionada: 28/01/2021  Nº de Registros: 2 --> Fecha resultante: 14/01/2021

Una vez tengo esa fecha resultante, necesito filtrar la tabla de valores para que muestre sólo aquellos registros comprendidos entre la Fecha resultante y la Fecha Selecciona, por ejemplo ...  14/01/2021, 15/01/2021, 16/01/2021 ... 28/01/2021.

 

Me puedes explicar cómo podría aplicar estos cálculos y filtros desde los segmentadores ?

 

Les agradezco de antemano su ayuda. Mil gracias a todos.

1 REPLY 1
lbendlin
Super User
Super User

If your calendar table is linked to your data model (as it should be) then your approach will not work. You need to create a separate table with dates and use that new table for the date slicer.

 

Then you can use the SELECTEDVALUE() function for both the Date slicer and the week count slicer to compute your measure.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.