Solved

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

Posted on 2014-07-27
2
641 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
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…

776 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