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

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.

Reply
dlopezm
Frequent Visitor

El filtro CALCULATE está reemplazando otras columnas de la tabla Calendar

Hola

Tengo una mesa con Budget para años pasados y año en curso. Medida presupuestaria. El eje de la visualización proviene de la tabla de calendario.

Budget.png

Modelo de datos con tabla de calendario. La tabla de calendario se define en el Editor de consultas.

Data Model.png

A continuación, utilizo CALCULATE para modificar los filtros y obtener el presupuesto del año actual. Todo bien hasta aquí.

Budget Offset.png

Pero cuando agrego Calendar[Date] <-TODAY() como un segundo filtro, obtengo el mismo valor para todos los meses, incluidos los meses no del año actual.

Budget Today.png

Lo que esperaba era obtener sólo el presupuesto de cada uno de los meses del año en curso que ya han pasado.

¿Qué es lo que no veo? ¿CACLULATE está reemplazando un filtro? ¿Cuál y por qué?

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@dlopezm probar esto

Budget Current Year = 
CALCULATE ( [Budget], Calendar[Year Offset] = 0,
KEEPFILTERS( Calendar[Date] <= TODAY() )
)

Me gustaría elogiossi mi solución me ayudó.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@dlopezm probar esto

Budget Current Year = 
CALCULATE ( [Budget], Calendar[Year Offset] = 0,
KEEPFILTERS( Calendar[Date] <= TODAY() )
)

Me gustaría elogiossi mi solución me ayudó.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Gracias @parry2k, su propuesta está funcionando.

Pero mi pregunta es también "¿Por qué CALCULATE() reemplaza los filtros aplicados a la visualización?" ya que no estoy usando la columna Calendar[Date] como filtro en cualquier lugar de la visualización.

@dlopezm cuando se utiliza una condición como esta Tabla[Fecha] < ? HOY(), se convierte en FILTER( ALL ( Table[Date] ), Table[Date] < ? TODAY() ) y es por eso que el valor se estaba repitiendo. Espero que ayude.

Me gustaría elogiossi mi solución me ayudó.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Lo que no estoy recibiendo es: ¿por qué la visualización elimina Calendar[Year] y Calendar[Month] como filtros cuando utilizo Calendar[Date] <-TODAY() dentro de CALCULATE() pero no elimina el filtro cuando uso Calendar[Year Offset] a 0 , aunque vengan de la misma tabla, la tabla Calendar.

¿Mi pregunta tiene algún sentido @parry2k?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.