Forum Discussion
Absence Data Plotted as Lost Days Per Month
Hi Anonymous,
I add calculated column to your table store unique 'emp no' and 'abs code', then I create a expand table with emp/abs and detail date and a table with unique emp/abs value to link above tables.
Calculated column:
EMP/ABS = [Emp_No]&"/"&[Abs_Code]
Calculated tables:
Expand =
VAR _calendar =
CALENDAR (
MINX ( VALUES ( Absence[Abs_Start_Date] ), [Abs_Start_Date] ),
MAXX ( VALUES ( Absence[Abs_End_Date] ), [Abs_End_Date] )
)
RETURN
SELECTCOLUMNS (
FILTER (
CROSSJOIN ( Absence, _calendar ),
[Date] >= [Abs_Start_Date]
&& [Date] <= [Abs_End_Date]
),
"Emp/ABS", [EMP/ABS],
"Detail Date", [Date]
)
Bridge = VALUES(Absence[EMP/ABS])
After these steps, I can create a matrix visual with emp no and abs code as row fields, date as column fields. I still not so sure how did you calculate the value fields, can you please explain more about this?
Regards,
Xiaoxin Sheng
Hi Anonymous,
I'm attempting to create the calculated table you suggested with:
Expand = VAR _calendar = CALENDAR ( MINX ( VALUES ( Absence[Abs_Start_Date] ), [Abs_Start_Date] ), MAXX ( VALUES ( Absence[Abs_End_Date] ), [Abs_End_Date] ) ) RETURN SELECTCOLUMNS ( FILTER ( CROSSJOIN ( Absence, _calendar ), [Date] >= [Abs_Start_Date] && [Date] <= [Abs_End_Date] ), "Emp/ABS", [EMP/ABS], "Detail Date", [Date] ) Bridge = VALUES(Absence[EMP/ABS])
However I'm getting a sytax error on the 'bridge' element.
Can you help?
Many thanks,
Geneve