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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cjones97
Frequent Visitor

How to Identify Old Subscription Entries

I have a dataset with multiple subscription entries (with start and end dates). For a particular name, I want to create a column that identifies the old subscription (but only if it renewed), so I can filter it out. Thank you for any and all help!

 

For a particular Name, if this row's End Date - another row's Start Date = - 1, then 1, if not 0

 

Entry 1: Name = George; Start Date = 1/1/2021; End Date = 12/31/2021, New Column = 1

Entry 2: Name = George; Start Date = 1/1/2022; End Date = 12/31/2022, New Column = 0

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

HI @cjones97 ,

Pls test the below dax to create the below two column:

rank = RANKX(FILTER('Table','Table'[Name ]=EARLIER('Table'[Name ])),'Table'[Start Date],,DESC,Dense) 
Column = IF(DATEDIFF( 'Table'[End Date], CALCULATE(MAX('Table'[Start Date]),FILTER(ALL('Table'),'Table'[rank]=EARLIER('Table'[rank])-1&&'Table'[Name ]=EARLIER('Table'[Name ]))),DAY)=1,1,0)

Output result:

vluwangmsft_0-1656922859874.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

1 REPLY 1
v-luwang-msft
Community Support
Community Support

HI @cjones97 ,

Pls test the below dax to create the below two column:

rank = RANKX(FILTER('Table','Table'[Name ]=EARLIER('Table'[Name ])),'Table'[Start Date],,DESC,Dense) 
Column = IF(DATEDIFF( 'Table'[End Date], CALCULATE(MAX('Table'[Start Date]),FILTER(ALL('Table'),'Table'[rank]=EARLIER('Table'[rank])-1&&'Table'[Name ]=EARLIER('Table'[Name ]))),DAY)=1,1,0)

Output result:

vluwangmsft_0-1656922859874.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.