• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Check for overlapping dates in their position of trust for each member|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Check for overlapping dates in their position of trust for each member|Power Query|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryCheck for overlapping dates in thei…
sp_PrintTopic sp_TopicIcon
Check for overlapping dates in their position of trust for each member
Avatar
Dan Witthoeft

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
August 16, 2021
sp_UserOfflineSmall Offline
1
August 16, 2021 - 5:51 pm
sp_Permalink sp_Print
We are getting a new membership system at my work and needs to wash the data we are converting, and there Power Query is were helpful.
 
A member can have had several "positions of trust" with a start and end date. But the old system did not check for overlap between the dates on their different "positions of trust".
I need for each member to test if there is a overlap in the dates and check that "Date To" is larger than "Date from" in each "Position of trust".
I have enclosed a excampel file with the following columns Membernumber, Position of trust, Date From and Date To. in the area A5:D50
I have mark some of the fields, that shoud give overlap.
I have loaded the data in to Power Query where I have grouped the Membernumber, made an index to get how many positions of trust a member has has had. Then I normalized the Dato From an Date To columns.
But how can I make the controls of overlapping dates i Power query ?
 
(I made the check with if formels in the original file, but it makes my file so havy and slow)
 
sp_AnswersTopicSeeAnswer See Answer
Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
2
August 16, 2021 - 7:23 pm
sp_Permalink sp_Print

Hello Dan,

Sorry, no file attached. You need to click the Start Upload button after you have added the file.

Br,
Anders

Avatar
Dan Witthoeft

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
August 16, 2021
sp_UserOfflineSmall Offline
3
August 18, 2021 - 3:39 pm
sp_Permalink sp_Print sp_EditHistory
We are getting a new membership system at my work and needs to wash the data we are converting, and there Power Query is were helpful.
 
A member can have had several "positions of trust" with a start and end date. But the old system did not check for overlap between the dates on their different "positions of trust".
I need for each member to test if there is a overlap in the dates and check that "Date To" is larger than "Date from" in each "Position of trust".
I have enclosed a excampel file with the following columns Membernumber, Position of trust, Date From and Date To. in the area A5:D50
I have mark some of the fields, that shoud give overlap.
I have loaded the data in to Power Query where I have grouped the Membernumber, made an index to get how many positions of trust a member has has had. Then I normalized the Dato From an Date To columns.
But how can I make the controls of overlapping dates i Power query ?
 
(I made the check with if formels in the original file, but it makes my file so havy and slow)

 

I try to upload the file again

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
4
August 19, 2021 - 6:26 am
sp_Permalink sp_Print sp_EditHistory

Hello Dan,

I am not skilled enough in Power Query to look for a solution using that tool, I have instead looked into highlighting the overlapping dates using conditional formatting, see attached file for an example.

The cells previously highlighted in red are now coloured in light gold, except cell C16, but based on other rows with similar scenario where To and From date are the same but not highlighted by you I assume this can be skipped.

The formulaes in the conditional formatting rules only checks the above or below rows, so if it is needed to be checked in a larger scale then this needs to be adjusted, for such perhaps a solution needs to be found using Power Query.

I hope it gives some help.

Br,
Anders

sp_AnswersTopicAnswer
Answers Post
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
5
August 19, 2021 - 3:15 pm
sp_Permalink sp_Print

Hi Dan,

Can you clarify the following case? You have highlighted in red below an overlapping:

10000206 Østerhåbskolen afd. Torsted 1/12/1994 8/03/1999
10000206 Egebjergskolen 9/03/1999 1/04/2003
10000206 Egebjergskolen 1/02/2003 1/04/2003
10000206 Egebjergskolen 1/01/2008 1/10/2014
10000206 Samsø Skole 1/10/2014 31/01/2015
10000206 Samsø Skole 1/02/2015 31/12/9999

You mentioned that:

If a member has more than one "Position of trust" I need to check if the next "Position of trust" has a "Date from" that i larger or equal to the "Date To" in the earlier "position of trust"

What you have highlighted does not follow your description: the overlapping is between the SAME position of trust, not earlier position of trust.

Avatar
Dan Witthoeft

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
August 16, 2021
sp_UserOfflineSmall Offline
6
August 20, 2021 - 5:04 am
sp_Permalink sp_Print

Hi Catalin

I Can ser what you mean. In the test file I didn’t put all the fields in the list, and the is some other fields that is different. I should have taken that one to. It was therefore I made the index so I could see which separate the different positions.

Avatar
Dan Witthoeft

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
August 16, 2021
sp_UserOfflineSmall Offline
7
August 20, 2021 - 5:07 am
sp_Permalink sp_Print

Hello Anders

I am not by by laptop this evening, but will look in to your suggestion tomorrow.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Richard West, Shanna Henseler, Lawrence Smith, Nada Perovic
Guest(s) 12
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6212
Posts: 27236

 

Member Stats:
Guest Posters: 49
Members: 31889
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.