Forum Discussion
Sales VS Attendance
- Anonymous7 years ago
Sorry about that
Change the calculated column as under
Salesmen =VAR CurrentTime =FORMAT ( Sales[Time], "HH:MM" )VAR SalesPerson =CALCULATETABLE (SUMMARIZE ( Attendance, Attendance[Employee] ),CurrentTime >=FORMAT ( ( Attendance[IN] ), "HH:MM" ),CurrentTime <=FORMAT ( ( Attendance[OUT] ), "HH:MM" ))RETURNCONCATENATEX ( SalesPerson, [Employee], "," )Let me know if it works.CheersCheenuSing
Hi gkalandadze ,
Here are the steps I followed
1. In the Attendance Table set the IN and OUT as TIME(HH:MM)
2. Sorted the Attendance Table by Employee
3. In the Sales Table set the TIme as TIME(HH:MM)
Added a calculated Column SalesMen In SalesTable as
Salesmen =
VAR CurrentTime =
FORMAT ( Sales[Time], "HH:MM" )
VAR SalesPerson =
CALCULATETABLE (
SUMMARIZE (
UNION (
CALCULATETABLE (
SUMMARIZE ( Attendance, Attendance[Employee] ),
FORMAT ( ( Attendance[IN] ), "HH:MM" ) >= CurrentTime
),
CALCULATETABLE (
SUMMARIZE ( Attendance, Attendance[Employee] ),
CurrentTime <= FORMAT ( ( Attendance[OUT] ), "HH:MM" )
)
),
[Employee]
)
)
RETURN
CONCATENATEX ( SalesPerson, [Employee], "," )
Atttached the Pbix
Cheers
CheenuSing
thanks!
Anonymous
but seem to be a little error. George shouldn't be in sales before 11:20 (time he came) and in your list he appears from the start (((
- Anonymous7 years agoNot applicable
Sorry about that
Change the calculated column as under
Salesmen =VAR CurrentTime =FORMAT ( Sales[Time], "HH:MM" )VAR SalesPerson =CALCULATETABLE (SUMMARIZE ( Attendance, Attendance[Employee] ),CurrentTime >=FORMAT ( ( Attendance[IN] ), "HH:MM" ),CurrentTime <=FORMAT ( ( Attendance[OUT] ), "HH:MM" ))RETURNCONCATENATEX ( SalesPerson, [Employee], "," )Let me know if it works.CheersCheenuSing