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
Termenoque
Frequent Visitor

Valor basado en la última fecha

Hola, estoy tratando de obtener el último valor (volumen de tickets abierto) basado en la última fecha de la tabla, pero no llegar a ningún lugar rápido. He intentado crear medidas var y aunque obtengo un resultado no es igual al último valor.

En la siguiente tabla estoy tratando de obtener el último valor abierto de 1186 basado en la última fecha,para que luego pueda dividirlo por otra medida de promedio de volumen resuelto MTD.

Cualquier ayuda que pueda proporcionar sería muy bienvenida - este me está dando una cabeza dolorida. La solución tiene que ser compatible con PBI Server Desktop (versión enero) no con PBI Service. Gracias 🙂

Termenoque_0-1597931569861.png

1 ACCEPTED SOLUTION

Hola @Termenoque ,

Por favor, compruebe:

1. Cree una tabla Fechas.

Dates =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2020, 6, 1 ), DATE ( 2020, 9, 30 ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "MonthName", FORMAT ( [Date], "MMM" )
)

2. Ordene la columna "MonthName" por la columna "Mes".

MTD3.jpg

3. Cree una relación entre la tabla Dates y la tabla de hechos.

MTD4.jpg

4. Crear medidas.

MTD Average Inbound volume = 
TOTALMTD ( AVERAGE ( 'Table'[Inbound] ), 'Dates'[Date] )
MTD Average Resolved Volume = 
TOTALMTD ( AVERAGE ( 'Table'[Resolved] ), Dates[Date] )
Last Date = 
VAR LastDate_ =
    CALCULATE ( MAX ( 'Table'[DateResolved] ), ALLSELECTED ( 'Table' ) )
VAR LastDateMonth =
    MONTH ( LastDate_ )
RETURN
    IF ( MAX ( Dates[Month] ) = LastDateMonth, LastDate_ )
Last Open Volume on last date = 
IF (
    [Last Date] <> BLANK (),
    CALCULATE (
        MAX ( 'Table'[Open] ),
        FILTER ( 'Table', 'Table'[DateResolved] = [Last Date] )
    )
)
No of days to clear volume based on Avg Resolved volume = 
[Last Open Volume on last date] / [MTD Average Resolved Volume]

5. Cree un objeto visual Matrix y establezca el valor "show on rows".

MTD.PNG

MTD2.PNG

BTW, archivo .pbix adjunto.

Saludos

Icey

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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Termenoque, el número no es muy claro con los datos que proporcionó. puede explicar con ejemplo

¿Puede compartir datos de ejemplo y salida de ejemplo en un formato de tabla?

en caso de que tenga fecha de apertura / cierre. A continuación, consulte

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

@amitchandak  As requested, here is the table and hopefully clearer explannation of what I'm trying to achieve.

DateResolvedCountryInboundOpenResolved
26/07/20DE15870
26/07/20UK4318372
27/07/20DE137635121
27/07/20UK3401960361
28/07/20DE151619175
28/07/20UK4232013310
29/07/20DE133612128
29/07/20UK4732110351
30/07/20DE129633114
30/07/20UK3242045388
31/07/20DE121598155
31/07/20UK3311941389
01/08/20UK2018478
02/08/20UK1818580
03/08/20DE148593126
03/08/20UK3651960364
04/08/20DE146596116
04/08/20UK3121884349
05/08/20DE109557193
05/08/20UK2671827317
06/08/20DE160583113
06/08/20UK2811808270
07/08/20DE130583132
07/08/20UK2841753282
08/08/20DE15740
08/08/20UK1916787
09/08/20UK1516846
10/08/20DE124591125
10/08/20UK3251736322
11/08/20DE110570121
11/08/20UK3261722302
12/08/20DE138560133
12/08/20UK3391663297
13/08/20DE13257596
13/08/20UK3211632294
14/08/20DE125598112
14/08/20UK2331472384
15/08/20DE15811
15/08/20UK713983
16/08/20DE15800
16/08/20UK213904
17/08/20DE37462169
17/08/20UK271186310

 

What we are trying to achieve in PBI

JulAug
MTD Average Inbound volume217146
MTD Average Resolved Volume208160
      
      
Last Date:17/08/20  
  Last Open Volume on last date:1186  
No of days to clear volume based on Avg Resolved volume7.4Last Open Volume ÷ MTD Average Resolved Volume

 

Hola @Termenoque ,

Por favor, compruebe:

1. Cree una tabla Fechas.

Dates =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2020, 6, 1 ), DATE ( 2020, 9, 30 ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "MonthName", FORMAT ( [Date], "MMM" )
)

2. Ordene la columna "MonthName" por la columna "Mes".

MTD3.jpg

3. Cree una relación entre la tabla Dates y la tabla de hechos.

MTD4.jpg

4. Crear medidas.

MTD Average Inbound volume = 
TOTALMTD ( AVERAGE ( 'Table'[Inbound] ), 'Dates'[Date] )
MTD Average Resolved Volume = 
TOTALMTD ( AVERAGE ( 'Table'[Resolved] ), Dates[Date] )
Last Date = 
VAR LastDate_ =
    CALCULATE ( MAX ( 'Table'[DateResolved] ), ALLSELECTED ( 'Table' ) )
VAR LastDateMonth =
    MONTH ( LastDate_ )
RETURN
    IF ( MAX ( Dates[Month] ) = LastDateMonth, LastDate_ )
Last Open Volume on last date = 
IF (
    [Last Date] <> BLANK (),
    CALCULATE (
        MAX ( 'Table'[Open] ),
        FILTER ( 'Table', 'Table'[DateResolved] = [Last Date] )
    )
)
No of days to clear volume based on Avg Resolved volume = 
[Last Open Volume on last date] / [MTD Average Resolved Volume]

5. Cree un objeto visual Matrix y establezca el valor "show on rows".

MTD.PNG

MTD2.PNG

BTW, archivo .pbix adjunto.

Saludos

Icey

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

@amitchandak Thanks for the help - got it to work eventually 🙂

@Icey Gracias por su ayuda - consiguió que funcionara finalmente 🙂

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.