Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi all,
I have the following DAX code:
Calculated table =
VAR __Filter =
CALCULATETABLE (
VALUES ( 'Logged Clockings'[Employee Clock Number] ),
'Logged Clockings'[Touch Description] = "Shift End"
)
VAR __Result =
FILTER (
SUMMARIZECOLUMNS (
'Logged Clockings'[Date],
'Logged Clockings'[Employee Clock Number]
),
NOT ( 'Logged Clockings'[Employee Clock Number] ) IN __Filter
)
RETURN
__Result
I need this code to run for the last date in 'Logged Clockings' table (which is essentially today, or tomorrow if I view the table tomorrow). Any help is appreciated!
I tried using LASTDATE in the code above but did not work.
Thanks in advance!
Midhun
Solved! Go to Solution.
Thanks for the sample data. See if this has better performance:
Today Table =
VAR _SE =
CALCULATETABLE (
VALUES ( 'Logged Clockings'[Employee Clock Number] ),
FILTER (
'Logged Clockings',
'Logged Clockings'[Touch Description] = "Shift End"
&& 'Logged Clockings'[Date] = TODAY ()
)
)
VAR _ACN =
CALCULATETABLE (
VALUES ( 'Logged Clockings'[Employee Clock Number] ),
FILTER ( 'Logged Clockings', 'Logged Clockings'[Date] = TODAY () )
)
VAR _Net =
EXCEPT ( _ACN, _SE )
RETURN
SUMMARIZE (
FILTER (
'Logged Clockings',
'Logged Clockings'[Date] = TODAY ()
&& 'Logged Clockings'[Employee Clock Number] IN _Net
),
'Logged Clockings'[Date],
'Logged Clockings'[Employee Clock Number]
)
Proud to be a Super User!
Paul on Linkedin.
In that case try:
Calculated table =
SUMMARIZE (
FILTER (
'Logged Clockings',
'Logged Clockings'[Touch Description] <> "Shift End"
&& 'Logged Clockings'[Date] = TODAY ()
),
'Logged Clockings'[Date],
'Logged Clockings'[Employee Clock Number]
)
Proud to be a Super User!
Paul on Linkedin.
Hi @PaulDBrown ,
I tried your DAX solution (instead of mine which is inefficient by the way), and there is a slight change in the output. Before I explain let me give you a bit of context by giving you a sample dataset:
The FILTER() in your DAX code means now I have rows for "Shift Start", "Break Start" and "Break End" corresponding to an employee. So my final output will also have the "Employee Clock Number" of someone who clocked out of a shift, i.e., has a "Shift End" row corresponding to the clock number.
It's better understood when you try it one the sample data!
Thanks for your reply!
Midhun
Thanks for the sample data. See if this has better performance:
Today Table =
VAR _SE =
CALCULATETABLE (
VALUES ( 'Logged Clockings'[Employee Clock Number] ),
FILTER (
'Logged Clockings',
'Logged Clockings'[Touch Description] = "Shift End"
&& 'Logged Clockings'[Date] = TODAY ()
)
)
VAR _ACN =
CALCULATETABLE (
VALUES ( 'Logged Clockings'[Employee Clock Number] ),
FILTER ( 'Logged Clockings', 'Logged Clockings'[Date] = TODAY () )
)
VAR _Net =
EXCEPT ( _ACN, _SE )
RETURN
SUMMARIZE (
FILTER (
'Logged Clockings',
'Logged Clockings'[Date] = TODAY ()
&& 'Logged Clockings'[Employee Clock Number] IN _Net
),
'Logged Clockings'[Date],
'Logged Clockings'[Employee Clock Number]
)
Proud to be a Super User!
Paul on Linkedin.
Try:
Calculated table =
SUMMARIZE (
FILTER (
'Logged Clockings',
'Logged Clockings'[Touch Description] <> "Shift End"
),
'Logged Clockings'[Date],
'Logged Clockings'[Employee Clock Number]
)
Proud to be a Super User!
Paul on Linkedin.
Hi Paul,
Thanks for replying. What I meant was:
The CALCULATETABLE function refers to value in 'Logged Clockings' and I only want the rows that correspond to today's date from Logged Clockings.
I have a solution but I don't think it's the most efficient. I created another calculated column:
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 18 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 51 | |
| 44 | |
| 43 | |
| 39 | |
| 32 |