Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I’m trying to solve the following:
I have one excel table contains columns of values(ID) and startTime + endTime for every week
I would like to count and also list only the new added values from the previous week
For example: first 7 values from first week, then 9 values fron second week , then 10 values
ID | startTime | endTime | |||
a | 02-Jul-24 | 09-Jul-24 | |||
b | 02-Jul-24 | 09-Jul-24 | |||
c | 02-Jul-24 | 09-Jul-24 | |||
d | 02-Jul-24 | 09-Jul-24 | |||
e | 02-Jul-24 | 09-Jul-24 | |||
f | 02-Jul-24 | 09-Jul-24 | |||
g | 02-Jul-24 | 09-Jul-24 | |||
a | 09-Jul-24 | 16-Jul-24 | |||
c | 09-Jul-24 | 16-Jul-24 | |||
d | 09-Jul-24 | 16-Jul-24 | |||
f | 09-Jul-24 | 16-Jul-24 | |||
g | 09-Jul-24 | 16-Jul-24 |
|
| |
h | 09-Jul-24 | 16-Jul-24 |
|
| |
i | 09-Jul-24 | 16-Jul-24 | |||
j | 09-Jul-24 | 16-Jul-24 | |||
k | 09-Jul-24 | 16-Jul-24 | count of new IDs from previous week should be 4 | list only the added new IDs should be h,I,j,k | |
a | 16-Jul-24 | 23-Jul-24 | |||
b | 16-Jul-24 | 23-Jul-24 | |||
c | 16-Jul-24 | 23-Jul-24 | |||
d | 16-Jul-24 | 23-Jul-24 | |||
e | 16-Jul-24 | 23-Jul-24 | |||
g | 16-Jul-24 | 23-Jul-24 |
|
| |
h | 16-Jul-24 | 23-Jul-24 | |||
i | 16-Jul-24 | 23-Jul-24 | |||
j | 16-Jul-24 | 23-Jul-24 | |||
k | 16-Jul-24 | 23-Jul-24 | count of new IDs from previous week should be2 | list only the added new IDs should be b,e |
Is that achievable with DAX ?
Solved! Go to Solution.
@barakm Try these. PBIX is attached below signature.
Count New Measure =
VAR __CurrentWeek = MAX('Table'[startTime])
VAR __Current = DISTINCT( 'Table'[ID] )
VAR __Previous = DISTINCT( SELECTCOLUMNS( FILTER( ALL('Table'), [startTime] = __CurrentWeek - 7 ), "ID", [ID] ) )
VAR __New = EXCEPT( __Current, __Previous)
VAR __Result = COUNTROWS( __New )
RETURN
__Result
List New Measure =
VAR __CurrentWeek = MAX('Table'[startTime])
VAR __Current = DISTINCT( 'Table'[ID] )
VAR __Previous = DISTINCT( SELECTCOLUMNS( FILTER( ALL('Table'), [startTime] = __CurrentWeek - 7 ), "ID", [ID] ) )
VAR __New = EXCEPT( __Current, __Previous)
VAR __Result = CONCATENATEX( __New, [ID], "," )
RETURN
__Result
@barakm Try these. PBIX is attached below signature.
Count New Measure =
VAR __CurrentWeek = MAX('Table'[startTime])
VAR __Current = DISTINCT( 'Table'[ID] )
VAR __Previous = DISTINCT( SELECTCOLUMNS( FILTER( ALL('Table'), [startTime] = __CurrentWeek - 7 ), "ID", [ID] ) )
VAR __New = EXCEPT( __Current, __Previous)
VAR __Result = COUNTROWS( __New )
RETURN
__Result
List New Measure =
VAR __CurrentWeek = MAX('Table'[startTime])
VAR __Current = DISTINCT( 'Table'[ID] )
VAR __Previous = DISTINCT( SELECTCOLUMNS( FILTER( ALL('Table'), [startTime] = __CurrentWeek - 7 ), "ID", [ID] ) )
VAR __New = EXCEPT( __Current, __Previous)
VAR __Result = CONCATENATEX( __New, [ID], "," )
RETURN
__Result
Thank you Greg, I manage to copy the DAX code and numbers seems to be OK 😀. as for the list of the value I I would like to see it in a table where I could choose with a slicer which week to show... for some reason I was not able to download your PBIX, maybe you can try send it my email ? barak.m7@gmail.com ... but overall I'm very happy with what you've sent till now, amazing ! of course I'll be happy to mark your post as a solution.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |