Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

749 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