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.
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 :
Id | Tipo de licencia | Resto Balance | Fecha de transacción |
2283 | Vacaciones Anuales | 30 | 1/1/2020 |
2283 | Vacaciones Anuales | -1 | 2/20/2020 |
2283 | Vacaciones Anuales | -1 | 2/21/2020 |
2283 | Vacaciones Anuales | -1 | 2/25/2020 |
2283 | Vacaciones Anuales | -1 | 4/27/2020 |
2283 | Vacaciones Anuales | -1 | 4/28/2020 |
2283 | Licencia por enfermedad | 0 | 1/1/2020 |
2283 | Licencia por enfermedad | -1 | 1/10/2020 |
2283 | Licencia por enfermedad | -1 | 3/2/2020 |
2283 | Licencia por enfermedad | -1 | 3/9/2020 |
2283 | Licencia por enfermedad | -1 | 3/10/2020 |
2283 | Licencia por enfermedad | -1 | 3/11/2020 |
2283 | Licencia por enfermedad | -1 | 4/6/2020 |
2283 | Licencia por enfermedad | -1 | 5/4/2020 |
2283 | Licencia por enfermedad | -1 | 5/5/2020 |
2283 | Licencia por enfermedad | -1 | 5/6/2020 |
2283 | Licencia no remunerada | 0 | 1/1/2020 |
Necesidad de salida como:
Id | Tipo de licencia | Fecha de inicio | Fecha de finalización | Hojas | Saldo restante |
2283 | Vacaciones Anuales | 1/1/2020 | 1/1/2020 | 30 | 30 |
2283 | Vacaciones Anuales | 2/20/2020 | 2/21/2020 | -2 | 28 |
2283 | Vacaciones Anuales | 2/25/2020 | 2/25/2020 | -1 | 27 |
2283 | Vacaciones Anuales | 4/27/2020 | 4/28/2020 | -2 | 25 |
2283 | Licencia por enfermedad | 1/1/2020 | 1/1/2020 | 0 | 0 |
2283 | Licencia por enfermedad | 1/10/2020 | 1/10/2020 | -1 | -1 |
2283 | Licencia por enfermedad | 3/2/2020 | 3/2/2020 | -1 | -2 |
2283 | Licencia por enfermedad | 3/9/2020 | 3/11/2020 | -3 | -5 |
2283 | Licencia por enfermedad | 4/6/2020 | 4/6/2020 | -1 | -6 |
2283 | Licencia por enfermedad | 5/4/2020 | 5/6/2020 | -3 | -9 |
2283 | Licencia no remunerada | 1/1/2020 | 1/1/2020 | 0 | 0 |
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á:
Para el archivo .pbix relacionado, haga clic aquí.
@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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |