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
pankajj
Helper III
Helper III

Días máximos acumulados

¡Saludos!

Tengo problemas para conseguir días acumulados de Max.

Para calcular la misma he utilizado la siguiente medida:

Días máximos acumulados: CALCULATE(MAX(SN[DaysTillToday]), FILTER(ALL ('Dates'), 'Dates'[Date] <- MAX('Dates'[Date])))

Esto me da días máximos, pero no el resultado acumulativo.

Screenshot.png

He cargado PBIX & Excel archivo de datos de ejemplo como referencia

https://drive.google.com/drive/folders/1m3uGRUPN28hqKPab2oYSmzO91z9t0BT3?usp=sharing

Esperamos una guía rápida, por favor.

Gracias y saludos,

Pg

2 ACCEPTED SOLUTIONS

@pankajj

No he llegado exactamente lo que está tratando de hacer, pero esta medida le dará lo que necesita

Cumulative Max Days = 

CALCULATE(
    COUNT(Dates[Date]),
    FILTER(
        ALLSELECTED(Dates),
        Dates[Date] < MAX(Dates[Date] )
    )
)

Fowmy_0-1600717034861.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

@Fowmy 

 

Thanks a ton for your kind help. It worked perfectly with the sample file i shared.

 

In the meantime i created following measures to get the desired result in my existing data.

 

Open =
VAR
d = max(Dates[Date])
RETURN
calculate(
CALCULATE(count(SN[ID])+0,
SN,
SN[Created]<=d
),
crossfilter(SN[Created],Dates[Date],None)
)

OLDEST_Open_Date =
VAR
d = MAX(Dates[Date])
RETURN
CALCULATE(
FORMAT(CALCULATE(MIN(SN[Created]),
SN,
SN[Created]<=d),
"Short Date"
),
CROSSFILTER(SN[Created],Dates[Date],None)
)


Cumulative_Max_Days =
Var
d = Max(Dates[Date])
RETURN
CALCULATE(if([Open]>0,DATEDIFF(SN[OLDEST_Open_Date],d,Day),0))

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@pankajj

Para Total acumulado, debe utilizar la SUMA

Cumulative Max Days = 
CALCULATE(
    SUM(SN[DaysTillToday]), 
    FILTER(ALL ('Dates'), 'Dates'[Date] <= MAX('Dates'[Date]))
)

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy

Gracias por su respuesta rápida.

El uso de Sum en la medida me da el siguiente resultado:

Screenshot1.png

Sin embargo, estoy buscando un resultado que debería ser algo así como:

FechaDías máximos acumulados
Septiembre21 202013
Septiembre20 202012
Septiembre19 202011
Septiembre18 202010
Septiembre17 20209
Septiembre16 20208
Septiembre15 20207
Septiembre14 20206
Septiembre13 20205
Septiembre12 20204
Septiembre11 20203
Septiembre10 20202
Septiembre09 20201
Septiembre08 20200

@pankajj
¿Puede compartir datos de ejemplo de la fecha y la tabla de hechos, es acumulativo días máximos una medida?

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 

I have uploaded PBIX & Excel sample data file for reference

https://drive.google.com/drive/folders/1m3uGRUPN28hqKPab2oYSmzO91z9t0BT3?usp=sharing 

Thanks once again for your help.

@pankajj

No he llegado exactamente lo que está tratando de hacer, pero esta medida le dará lo que necesita

Cumulative Max Days = 

CALCULATE(
    COUNT(Dates[Date]),
    FILTER(
        ALLSELECTED(Dates),
        Dates[Date] < MAX(Dates[Date] )
    )
)

Fowmy_0-1600717034861.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 

 

Thanks a ton for your kind help. It worked perfectly with the sample file i shared.

 

In the meantime i created following measures to get the desired result in my existing data.

 

Open =
VAR
d = max(Dates[Date])
RETURN
calculate(
CALCULATE(count(SN[ID])+0,
SN,
SN[Created]<=d
),
crossfilter(SN[Created],Dates[Date],None)
)

OLDEST_Open_Date =
VAR
d = MAX(Dates[Date])
RETURN
CALCULATE(
FORMAT(CALCULATE(MIN(SN[Created]),
SN,
SN[Created]<=d),
"Short Date"
),
CROSSFILTER(SN[Created],Dates[Date],None)
)


Cumulative_Max_Days =
Var
d = Max(Dates[Date])
RETURN
CALCULATE(if([Open]>0,DATEDIFF(SN[OLDEST_Open_Date],d,Day),0))

@Fowmy

Lo sentimos por el error, el formato Html ha cambiado el contenido de la tabla.

Estoy buscando un resultado similar a :

Screenshot 2020-09-21 130825.png

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.