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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Syndicate_Admin
Administrator
Administrator

excluir a los nuevos empleados de los promedios salariales

Hola, sido mucho tiempo desde publicar aquí, pero aquí va;

Tengo tres tablas:

Transacciones:

fcastle_0-1629119219670.png

Empleado:

fcastle_1-1629119230711.png

y Date (tabla de fechas estándar), con estas relaciones:

fcastle_2-1629119303703.png

Tengo una medida:


Aumento salarial por año =
DÓNDE este año =
CALCULAR ( SUMA ( transacciones[Importe] ) )
DÓNDE año pasado =
CALCULAR ( SUMA ( transacciones[Importe] ), SAMEPERIODLASTYEAR ( 'Fecha'[Fecha] ) )
DÓNDE rawcalc = ( este año - año pasado ) / año pasado
DEVOLUCIÓN
SIERROR ( rawcalc, ESPACIO EN BLANCO () )

fcastle_4-1629119778498.png

Creo que necesito filtrar "este" totales de años basados en los individuos que tienen una suma en el año anterior, pero cada variante que intento parece ser un callejón sin salida.

Cualquier idea es muy apreciada!

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

7 REPLIES 7
Syndicate_Admin
Administrator
Administrator

Gracias por su asistencia @Greg_Deckler

Lo solucioné al leer esto.
https://p3adaptive.com/2015/08/nested-sumx-or-dax-query/

fcastle_0-1629201253201.png

Syndicate_Admin
Administrator
Administrator

@fcastle Probar:

Salary increase per year =
VAR thisyear =
    CALCULATE ( SUM ( transactions[Amount] ) )
VAR lastyear =
    CALCULATE ( SUM ( transactions[Amount] ), SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
VAR rawcalc = ( thisyear - lastyear ) / lastyear
RETURN
    IF(ISBLANK(lastyear),BLANK(),IFERROR ( rawcalc, BLANK () ))

@Greg_Deckler

Gracias, pero el problema persiste. Creo que la clave es encontrar una manera de pasar una lista de dimensiones (employeeid) a una medida de suma.

@fcastle Quizás:

Salary increase per year =
VAR __Table = SUMMARIZE('transactions',[employeeid],"increase",
VAR thisyear =
    CALCULATE ( SUM ( transactions[Amount] ) )
VAR lastyear =
    CALCULATE ( SUM ( transactions[Amount] ), SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
VAR rawcalc = ( thisyear - lastyear ) / lastyear
RETURN
    IF(ISBLANK(lastyear),BLANK(),IFERROR ( rawcalc, BLANK () )))
RETURN
  SUMX(__Table,[increase])

@Greg_Deckler

no cigarro desafortunadamente 🙂

fcastle_0-1629128691605.png

@fcastle Pegue los datos de ejemplo como texto o proporcione un vínculo a la tabla PBIX de ejemplo para que pueda volver a crearlos.

@Greg_Deckler

primero; muchas gracias por ayudar a un compañero, muy apreciado!

fcastle_0-1629138281273.png

vínculo al archivo de ejemplo:
https://1drv.ms/u/s!AtjU9aGZ2mSSgRqKvKE8ZC7ZLQZB?e=XTnfo9

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors