Solved

MS Excel 2013  - PowerPivot - DAX  How to compare today's date to another dates

Posted on 2014-07-27
2
621 Views
Last Modified: 2014-07-28
Hi All,
I have records in 3 tables of student and course

CourseID coursename   startdate                   enddate
   1             maths             06/26/2014               07/27/2014

 CourseStudentAssignment

CourseId   studentId     CourseStatus (computed column)
  1                 1  

I want to create a formula which checks the  startdate and enddate comparing to today's date

for eg :  If( Today'sdate > StartDate and today'sdate < endDate then CourseStatus = "On-going Course")
              if (Todays'Date < startDate then CourseStatus = "Not Started but student enrolled")
             If (Today'sDate > enddate then courseStatus  "Course completed")

please can you write down how to compare the above date to today's date.
0
Comment
Question by:BI 0824
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 40223873
Assuming you have the relationships set up between the tables, it would be something like:

=if(TODAY()>=related(Course[startdate]),if(today()<=related(Course[enddate]),"On-going Course","Course completed"),"Not Started but student enrolled")
0
 

Author Comment

by:BI 0824
ID: 40225795
Thanks Rory. Appreciate that. I also posted another question in same section.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now