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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
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.

 

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.