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

Necesidad de Representación tabular de Dax para Inicio y Fecha de Finalización

Hola

Tengo los siguientes datos y quiero representar en el siguiente formate. Quiero agregar el filtro de fecha en la parte superior sobre la base de la fecha de la transacción.

Datos Disponibles :

IdTipo de licenciaResto BalanceFecha de transacción
2283Vacaciones Anuales301/1/2020
2283Vacaciones Anuales-12/20/2020
2283Vacaciones Anuales-12/21/2020
2283Vacaciones Anuales-12/25/2020
2283Vacaciones Anuales-14/27/2020
2283Vacaciones Anuales-14/28/2020
2283Licencia por enfermedad01/1/2020
2283Licencia por enfermedad-11/10/2020
2283Licencia por enfermedad-13/2/2020
2283Licencia por enfermedad-13/9/2020
2283Licencia por enfermedad-13/10/2020
2283Licencia por enfermedad-13/11/2020
2283Licencia por enfermedad-14/6/2020
2283Licencia por enfermedad-15/4/2020
2283Licencia por enfermedad-15/5/2020
2283Licencia por enfermedad-15/6/2020
2283Licencia no remunerada01/1/2020

Necesidad de salida como:

IdTipo de licenciaFecha de inicioFecha de finalizaciónHojasSaldo restante
2283Vacaciones Anuales1/1/20201/1/20203030
2283Vacaciones Anuales2/20/20202/21/2020-228
2283Vacaciones Anuales2/25/20202/25/2020-127
2283Vacaciones Anuales4/27/20204/28/2020-225
2283Licencia por enfermedad1/1/20201/1/202000
2283Licencia por enfermedad1/10/20201/10/2020-1-1
2283Licencia por enfermedad3/2/20203/2/2020-1-2
2283Licencia por enfermedad3/9/20203/11/2020-3-5
2283Licencia por enfermedad4/6/20204/6/2020-1-6
2283Licencia por enfermedad5/4/20205/6/2020-3-9
2283Licencia no remunerada1/1/20201/1/202000

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hola @umarshehbaz ,

Necesita 4 medidas como se indica a continuación:

_measure = 
var _mindate= MINX(FILTER(ALL('Table'),'Table'[Leave Type]=MAX('Table'[Leave Type])&&'Table'[ID]=MAX('Table'[ID])&&'Table'[Index]<MAX('Table'[Index])&&'Table'[Transaction Date]=MAX('Table'[Transaction Date])-1),'Table'[Transaction Date])
Return
IF(_mindate=BLANK(),MAX('Table'[Transaction Date]),_mindate)
_Startdate = 
var _nextstartdate=CALCULATE([_measure],FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])+1))
Return
IF((MAX('Table'[Transaction Date])=[_measure])&&MAX('Table'[Transaction Date])<>_nextstartdate,'Table'[_measure],IF(_nextstartdate=MAX('Table'[Transaction Date])||_nextstartdate=[_measure],BLANK(),CALCULATE('Table'[_measure],FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1))))
_Leaveremaining = 
var _startdate=[_Startdate] return
IF(ISBLANK(_startdate),BLANK(),CALCULATE(SUM('Table'[RemainingBalance]),FILTER(ALLEXCEPT('Table','Table'[ID],'Table'[Leave Type]),'Table'[Transaction Date]>=_startdate&&'Table'[Transaction Date]<=MAX('Table'[Transaction Date]))))
_Remaining Balance = IF(ISBLANK('Table'[_Startdate]),BLANK(), CALCULATE(SUM('Table'[RemainingBalance]),FILTER(ALL('Table'),'Table'[Transaction Date]>=[_Startdate]&&'Table'[Transaction Date]<=MAX('Table'[Transaction Date])&&'Table'[Leave Type]=MAX('Table'[Leave Type]))))

Finalmente verá:

Annotation 2020-05-13 130236.png

Para el archivo .pbix relacionado, haga clic aquí.

Saludos
Kelly
¿Respondí a tu pregunta? ¡Marca mi puesto como solución!
amitchandak
Super User
Super User

@umarshehbaz , Sontion, antes de que se combinen las fechas de licencia

https://www.dropbox.com/s/i2wzkmvb7g31job/leaveDates.pbix?dl=0

Comprobación de la combinación de fechas de vacaciones

El saldo debe fusionarse y la fecha de finalización, así como por favor revise

Capture.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.