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
Anonymous
Not applicable

medida para sumar valores en una columna, filtrando sólo para el período más reciente

Hola, chicos

¿Alguien puede señalarme en la dirección correcta con esto, por favor?

Necesito crear una medida que resuma los valores en una columna, pero sólo mira el período más reciente por planta (ignorando todos los preídos anteriores). He resaltado en la imagen de abajo qué filas debe resumir.

PhoenixBird_1-1600341563982.png

Por lo tanto, en lugar de sumar los valores de cada mes de sinlge por ubicación (haciendo el total de 190), debería simplemente mirar el mes más reciente, por lo que calcularía 13+14+2 x 29.

¿Alguna idea?

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hola @PhoenixBird ,

Puede crear una medida como se indica a continuación:

Measure =
VAR _tab =
    SUMMARIZE (
        'Table',
        'Table'[Plant],
        "maxperiod", MAX ( 'Table'[Period] ),
        "mjFinding", MAX ( 'Table'[No of Major Findings] )
    )
RETURN
    SUMX ( _tab, [mjFinding] )

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
FrankAT
Community Champion
Community Champion

Hola @PhoenixBird

eche un vistazo a la siguiente solución:

21-09-_2020_11-28-53.png

Sum of No of Major Findings = SUM('Table'[No of Major Findings])

Sum of No of Minor Findings = SUM('Table'[No of Minor Findings])


Recent No of Major Findings = 
CALCULATE(
    [Sum of No of Major Findings],
    FILTER(
        ALLEXCEPT('Table','Table'[Plant]), 
        MAX('Table'[Periad]) = 'Table'[Periad]
    )
)


Recent No of Minor Findings = 
CALCULATE(
    [Sum of No of Minor Findings],
    FILTER(
        ALLEXCEPT('Table','Table'[Plant]), 
        MAX('Table'[Period]) = 'Table'[Period]
    )
)

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

v-yiruan-msft
Community Support
Community Support

Hola @PhoenixBird ,

Puede crear una medida como se indica a continuación:

Measure =
VAR _tab =
    SUMMARIZE (
        'Table',
        'Table'[Plant],
        "maxperiod", MAX ( 'Table'[Period] ),
        "mjFinding", MAX ( 'Table'[No of Major Findings] )
    )
RETURN
    SUMX ( _tab, [mjFinding] )

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@PhoenixBird , Usted puede hacerlo como

Pero necesitas un mes ordenado como el formato AAAAM

calcular( [no de maajor finidng], filter( Table,[Month Year Sort] á max(Month Year Sort])), allexcept(Table, Table[Plant]))

calculate(sum(Table [no of maajor finidng]), filter( Table,[Month Year Sort] á max(Month Year Sort])), allexcept(Table, Table[Plant]))

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.