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
sraj
Responsive Resident
Responsive Resident

Nueva medida para la última fecha y valor

Hola

Necesito ayuda con una nueva medida para obtener el último valor de fecha y equilibrio. Soy capaz de obtener la fecha de pago más reciente, pero necesito el saldo de la enfermedad 40.10. Adjuntar una copia del ejemplo.... cualquier ayuda es apreciada.

Capture.PNG

10 REPLIES 10
az38
Community Champion
Community Champion

hola @sraj

Tratar

Measure = 
var _lastDate = CALCULATE(MAX(Table[Latest PaymentDate], ALL(Table))

RETURN
CALCULATE(MAX(Table[Illness Balance]), Table[Latest PaymentDate] = _lastDate )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
sraj
Responsive Resident
Responsive Resident

HI @az38,

Probé lo que me recomendó y estaba funcionando bien al principio cuando utilicé el filtro para un empleado a la vez... y mostraría este último salario anual. Pero ahora no reconoce el filtro de nombre y aparece como en blanco, funciona si tengo todos los empleados mostrando y muestra el registro del último empleado con su actualización. No sé si esto tiene algún sentido, esperando que puedas imaginarlo.

LastAnnualSalary ?

var _lastDate á CALCULATE(MAX(kro_PAY_TRANSACTIONS[LastSalaryChangeDate]), ALL(kro_PAY_TRANSACTIONS))

devolución
CALCULATE (MAX(kro_PAY_TRANSACTIONS[AnnualSalary]), kro_PAY_TRANSACTIONS[LastSalaryChangeDate] - _lastDate )
az38
Community Champion
Community Champion

@sraj

tratar de añadir ALL() a cambio

LastAnnualSalary =

var _lastDate = CALCULATE(MAX(kro_PAY_TRANSACTIONS[LastSalaryChangeDate]), ALL(kro_PAY_TRANSACTIONS))

RETURN
CALCULATE (MAX(kro_PAY_TRANSACTIONS[AnnualSalary]), kro_PAY_TRANSACTIONS[LastSalaryChangeDate] = _lastDate, ALL(kro_PAY_TRANSACTIONS) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
sraj
Responsive Resident
Responsive Resident

Puede ser que tendría más sentido con la imagen aquí, por lo que trae la parte superior de la lista sin ningún filtro... pero cuando elijo a un empleado específicamente se muestra en blanco y con el TODO... muestra 57000 para el empleado que es la cantidad incorrecta.

Capture.PNG

az38
Community Champion
Community Champion

@sraj

¿cuál es el valor correcto? Veo lo que hemos planeado anteriormente:

la última fecha es 4/13/2020, por lo que el valor de la última fecha es 57000


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
sraj
Responsive Resident
Responsive Resident

Si filtro el apellido del empleado para mostrar solo para ese empleado... Todavía me da el 57000...en lugar de lo que la última cantidad de los empleados, es decir, 120K algo.

az38
Community Champion
Community Champion

@sraj

Para el filtro por empleado puede utilizar ALLEXCEPT()

LastAnnualSalary =

var _lastDate = CALCULATE(MAX(kro_PAY_TRANSACTIONS[LastSalaryChangeDate]), ALLEXCEPT(kro_PAY_TRANSACTIONS, kro_PAY_TRANSACTIONS[Employee]))

RETURN
CALCULATE (MAX(kro_PAY_TRANSACTIONS[AnnualSalary]), kro_PAY_TRANSACTIONS[LastSalaryChangeDate] = _lastDate, ALLEXCEPT(kro_PAY_TRANSACTIONS, kro_PAY_TRANSACTIONS[Employee]) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
sraj
Responsive Resident
Responsive Resident

Sigue siendo el mismo... ningún cambio.

sraj
Responsive Resident
Responsive Resident

Según su consejo, esto es lo que añadí.
Medida ?var _lastDate á CALCULATE(MAX(kro_checks_advices[PaymentDate], ALL(kro_checks_advices))
devolución
CALCULATE(MAX(kro_checks_advices[Saldo de la enfermedad]), kro_checks_advices[PaymentDate] - _lastDate )
Pero estoy recibiendo este mensaje de error
La sintaxis de 'RETURN' es incorrecta. (DAX(var _lastDate ? CALCULATE(MAX(kro_checks_advices[PaymentDate], ALL(kro_checks_advices))RETURNCALCULATE(MAX(kro_checks_advices[Illness Balance]), kro_checks_advices[PaymentDate] - _lastDate ))).
sraj
Responsive Resident
Responsive Resident

Según su consejo, esto es lo que añadí.
Medida ?var _lastDate á CALCULATE(MAX(kro_checks_advices[PaymentDate], ALL(kro_checks_advices))
devolución
CALCULATE(MAX(kro_checks_advices[Saldo de la enfermedad]), kro_checks_advices[PaymentDate] - _lastDate )
Pero estoy recibiendo este mensaje de error

La sintaxis de 'RETURN' es incorrecta. (DAX(var _lastDate ? CALCULATE(MAX(kro_checks_advices[PaymentDate], ALL(kro_checks_advices))RETURNCALCULATE(MAX(kro_checks_advices[Illness Balance]), kro_checks_advices[PaymentDate] - _lastDate ))).

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.