Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ChoiJunghoon
Helper III
Helper III

Count Created row and removed row compared with pervious data

Hi guy.

I am facing the big problem. please save me.

Table

DateIDDate index
2021-01-01A1
2021-01-01B1
2021-01-01C1
2021-01-02A2
2021-01-02D2
2021-01-02E2
2021-01-03A3
2021-01-03D3

 

I want 

Datenew Create rowRemoved row
2021-01-0130
2021-01-0222
2021-01-0301

 

2021-01-01 Created row : A & B & C  (3) /  Removed row : 0 

2021-01-02 Created row : D & E (2)         /  Removed : B & C (2) 

2021-01-03 Created row : 0                      /  Removed : E (1)

Could you make the DAX ?? 

1 ACCEPTED SOLUTION
stevedep
Memorable Member
Memorable Member

Here you go:

stevedep_0-1614066636594.png

NewRows = 
var _tblPrevDay   = CALCULATETABLE(VALUES('Table'[ID]), DATEADD(DateDim[Date].[Date], -1,DAY))
var _tblCurrent = VALUES('Table'[ID])
var _result = EXCEPT(_tblCurrent, _tblPrevDay)
return
COUNTROWS(_result)
// CONCATENATEX(_result, [ID] & "
// ") 

File is attached.

Kind regards, Steve. 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@ChoiJunghoon , Create measures like this with help from date table

 

This Day = CALCULATE(count('Table'[ID]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))


Last Day = CALCULATE(count('Table'[ID]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))

 

Created ID = countx(values(Table[ID]), if(isblank([Last Day]) && not(isblank([This Day])),[ID], blank()))

 

removed Created ID = countx(values(Table[ID]), if(not(isblank([Last Day])) && isblank([This Day]),[ID], blank()))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
stevedep
Memorable Member
Memorable Member

Here you go:

stevedep_0-1614066636594.png

NewRows = 
var _tblPrevDay   = CALCULATETABLE(VALUES('Table'[ID]), DATEADD(DateDim[Date].[Date], -1,DAY))
var _tblCurrent = VALUES('Table'[ID])
var _result = EXCEPT(_tblCurrent, _tblPrevDay)
return
COUNTROWS(_result)
// CONCATENATEX(_result, [ID] & "
// ") 

File is attached.

Kind regards, Steve. 

 

Thank you for your quick answer. 
Would you like to make the dax with "Date Index"? 
My Date column isn't generated every day.

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)