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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Sort on Start date / End date not following

Hi,

 

Hopefully someone can send me in the right direction, I have tried to search for some terms but I cant seem to find what I want.

 

I have a large set with contractnrs and start/end dates:

9192dbbe-6c4a-4328-a428-a21fa48bb19e.png

 

I want to filter out the orange Codes because there is only 1 row and I want to keep the values in Code where the same number is > 2.

 

The green dates are correct because 27-6-2022 and 28-6-2022 are following. (Values in column Code have the same numbers)

The red dates are not correct because there are some dates missing in between. (Values in column Code have the same numbers)

 

How can I filter only on dates that have missing dates in between (like the red dates)?

 

Thank you!

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can create a new column

ifmissing = 
VAR _next=minx(FILTER('Table','Table'[code]=EARLIER('Table'[code])&&'Table'[start]>EARLIER('Table'[end])),'Table'[start])
RETURN if(ISBLANK(_next)||_next='Table'[end]+1,blank(),"Y")

1.PNG

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can create a new column

ifmissing = 
VAR _next=minx(FILTER('Table','Table'[code]=EARLIER('Table'[code])&&'Table'[start]>EARLIER('Table'[end])),'Table'[start])
RETURN if(ISBLANK(_next)||_next='Table'[end]+1,blank(),"Y")

1.PNG

pls see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Thanks, that looks pretty advanced!

Unfortunately when i use your pbix and statement I get an error:

sanderVie_0-1658927395652.png

 

I solved it my creating a new column not in Power Query Editor, but in the table visualization.

sanderVie_0-1658928425574.png

 

Thanks! I will try to use it in my own pbix.

 

update:

It works in my own pbix as well.

 

Thanks so much!

 

you are welcome





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

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI 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.

Top Solution Authors
Top Kudoed Authors