Solved

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

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
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 …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

759 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