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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ChristoAClark
Frequent Visitor

Date row assistance

I have a list of dates for eligibility in row format. I am trying to ignore the end date if there is no gap between the start (eligible) and end date. For example, I want to show 1/04/2011 - 6/26/2011. This would be a better "at a glance" for the user. I have tried a number of things, but can't seem to wrap my head around what I am missing. Any help would be appreciated. 

 

ChristoAClark_0-1719530795406.png

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @ChristoAClark ,

Here is my sample data:
start dataend data

3/12/2008 3/11/2009
1/4/2011 3/1/2011
3/2/2011 6/21/2011
6/22/2011 6/26/2011
7/25/2011 2/20/2012
2/8/2013 7/26/2013
7/27/2013 8/3/2013
7/1/2024 9/8/2024
9/9/2024 11/1/2024

Add an Index column first:

Index = RANKX(ALL('table'), 'table'[start date], ,ASC, Dense)

vjunyantmsft_0-1719556948762.png

Then add a column as a Tag:

Tag = var a=[end date]+1
var b=[Index]
var c=LOOKUPVALUE('table'[start date],'table'[Index],[Index]+1)
return IF(a=c,1,0)

Use this DAX to create a calculated column for end date:

EndDate_range = IF([Tag]=0,[end date],MINX(FILTER('table',[Tag]=0&&[Index]>EARLIER('table'[Index])),[end date]))

And use this DAX to create a calculated column for start date:

StartDate_range = MINX(FILTER('table',[EndDate_range]=EARLIER('table'[EndDate_range])),[start date])

The final output is as below:

vjunyantmsft_1-1719557082158.png

In the table visual:

vjunyantmsft_2-1719557102570.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

ChristoAClark
Frequent Visitor

Holy cow! You are my new hero. THis works exactly as I hoped. Thanks so much. 

View solution in original post

2 REPLIES 2
ChristoAClark
Frequent Visitor

Holy cow! You are my new hero. THis works exactly as I hoped. Thanks so much. 

Anonymous
Not applicable

Hi @ChristoAClark ,

Here is my sample data:
start dataend data

3/12/2008 3/11/2009
1/4/2011 3/1/2011
3/2/2011 6/21/2011
6/22/2011 6/26/2011
7/25/2011 2/20/2012
2/8/2013 7/26/2013
7/27/2013 8/3/2013
7/1/2024 9/8/2024
9/9/2024 11/1/2024

Add an Index column first:

Index = RANKX(ALL('table'), 'table'[start date], ,ASC, Dense)

vjunyantmsft_0-1719556948762.png

Then add a column as a Tag:

Tag = var a=[end date]+1
var b=[Index]
var c=LOOKUPVALUE('table'[start date],'table'[Index],[Index]+1)
return IF(a=c,1,0)

Use this DAX to create a calculated column for end date:

EndDate_range = IF([Tag]=0,[end date],MINX(FILTER('table',[Tag]=0&&[Index]>EARLIER('table'[Index])),[end date]))

And use this DAX to create a calculated column for start date:

StartDate_range = MINX(FILTER('table',[EndDate_range]=EARLIER('table'[EndDate_range])),[start date])

The final output is as below:

vjunyantmsft_1-1719557082158.png

In the table visual:

vjunyantmsft_2-1719557102570.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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