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
12Bowers12
Helper V
Helper V

Calcular sin filtrado por mes

Buena mañana, todos,

Tengo una medida [Premium] trabaja en diferentes contextos, excepto por la fecha.

Por ejemplo, si quiero agrupar por mes, siempre devuelve la cantidad total constante para cada mes, sin ningún filtrado.

Agradezco su ayuda.

Dennis

Prima de la prima ?

VAR CurrentYear ( YEAR(MAX(DateIndex[AS_OF_DATE]))

VAR LatestDate á MAX(DateIndex[AS_OF_DATE])

devolución

CALCULAR (

SUM(PolicyData[NET_PREMIUM]),

DateDim[Año] - CurrentYear,

DateDim[Fecha] <-Fecha más reciente,

PolicyData[NET_PREMIUM] <> 0 )

6 REPLIES 6
parry2k
Super User
Super User

@12Bowers12 qué es la tabla dateindex? ¿Por qué estás filtrando el año y la última fecha? Si tiene una relación directa con la tabla de fechas y la tabla de transacciones, simplemente puede mostrar la suma utilizando la dimensión de mes desde la fecha. Parece que me estoy perdiendo algo aquí.



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.

Prray, creo que su punto es correcto.
Lo que realmente necesito es agregar la prima mensualmente para el año calendario actual 2020 a partir de la fecha de evaluación, como 06/30/2020.
La tabla DateDim cubre muchos años, incluyendo como el año calendario futuro como 2021, 2022, etc.
Para tratar este problema, creé una tabla con una fila y una columna que solo muestran el [As_Of_Date] 06/30/2020.

He probado si utilizar el argumento de filtro como se muestra a continuación, funciona pero muy lento.

¿Alguna mejora o solución?
Dennis

Premium_Filter de la casa de los

VAR CurrentYear ( YEAR(MAX(DateIndex[AS_OF_DATE]))

VAR LatestDate á MAX(DateIndex[AS_OF_DATE])

devolución

CALCULAR (

SUM(PolicyData[NET_PREMIUM]),

DateDim[Año] - CurrentYear,

DateDim[Fecha] <-Fecha más reciente,

FILTER( PolicyData, CALCULATE(SUM(PolicyData[NET_PREMIUM])) <> 0 ))

Hola @12Bowers12 ,

¿Por qué necesita FILTER( PolicyData, CALCULATE(SUM(PolicyData[NET_PREMIUM])) <> 0 ) en la fórmula?

Saludos

Dedmon Dai

Gracias, Dedmon,

Sin este argumento de filtrado, la medida no podría agrupar la prima mensualmente. Pero no sé por qué.

saludos

Dennis

Hola @12Bowers12 ,

Le sugiero que cree la siguiente medida sin crear una nueva tabla para una celda:

Premium_Filter = 
VAR _parameter = ...

VAR CurrentYear = YEAR(_parameter)

VAR LatestDate = _parameter

RETURN

   CALCULATE (

       SUM(PolicyData[NET_PREMIUM]),

       DateDim[Year] = CurrentYear,

       DateDim[Date] <= LatestDate,

      SUM(PolicyData[NET_PREMIUM])) <> 0 )

Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Saludos

Dedmon Dai

Gracias, Dedmon,

Lo intenté, pero no devolvió ningún valor. Lo probaré de nuevo más tarde.

Dennis

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.