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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ncl35
New Member

Check if record from table A falls within a date range in table B without looping

Hello

 

I'm new to PowerBI and would like some advice whether it is possible to determine if a date from table A falls within two dates in table B.  Here is an example of the tables:

 

TABLE A:

 

STUDENTACADEMIC YEARCOURSEREGISTRATION START DATEREGISTRATION END DATE
S1232017C00105/09/201710/12/2017
S1232017C00202/11/201715/12/2017
S1232017C00113/01/201830/03/2018
S4562017C00101/09/201731/07/2018
S7892017C00110/09/201731/07/2018

 

 

TABLE B:

STUDENTACADEMIC YEARCOURSELOGIN DATEXX  ACTIVE REGISTRATION XX
S1232017C00110/09/2017YES
S1232017C00205/12/2017YES
S1232017C00109/01/2018NO
S4562017C00101/09/2017NO

 

So, I would like XX ACTIVE REGISTRATION XX to be determined by comparing the login date with and checks whether it falls within REGISTRATION START DATE and  REGISTRATION END DATE.

 

( I would concatenate STUDENT, YEAR and COURSE and loop at table A to check whether login date falls with registration start and end date)

 

Any advice or potential solution would be much appreciated.

 

Thanks

 

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

@ncl35,

 

Here is an example for your reference.

Community Support Team _ Sam Zha
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

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@ncl35,

 

Here is an example for your reference.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

My initial thoughts on this is that there is nothing that ties the 3rd rows together really in terms of checking if it falls within those particular dates versus, for example, the first row.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for your prompt response.

 

One possible logic I was thinking of was for each entry in TABLE-B I would loop at TABLE-A macthing on STUDENT, YEAR and COURSE and then an 'if statement' to check whether TABLE-B Login Date falls with the Regitration Start and End Date of TABLE-A.

 

However, I can't see that I can apply that logic.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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