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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
TylerBrown
Frequent Visitor

Show Item as Active if given date falls between two dates

Hi all, I'm very new, working on building reporting for a college.

 

Right now I have a table with a list of courses, each has an associated instructor name, class start date, and class end date.  Ultimately what I want to end up with is a list of active teachers on a given date (or date range).  This would allow me to select "next week" or "today" and see who is in class.

 

I've been able to achieve something similar with slicers - but I can only filter based on class start date - so I can tell who started class, but not necesariliy who is still in class (our classes start/stop all the time). 

 

Thoughts?  I've been teaching myelf DAX so simple terms are appreciated.

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Share the link from where i can download your PBI file.  Also, share the underlying Excel file (from where you would have got data into the PBI file) so that i can connect to the Excel data source and carry out some M code transformations.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @TylerBrown,

 

I'd like some sample data with expect result to test and coding formula.

How to Get Your Question Answered Quickly

 

Regards,

Xiaoxin Sheng

Here's what I have been able to do with slicers (near the upper left), one referencing the start date, one referencing the end date.  It feels like there should be a more elegant way to identify if a class is active.  I have a sample of data to share, but I don't see an upload option.  How do I best share it?

 

Sample.png

 

Thank you for your time and effort.

Anonymous
Not applicable

Hi @TylerBrown,

 

I think you need a calendar table with not has relationship to current table,then you can use following formula to create a measure and drag it to visual level filter from table visual to filter 'Y' result records:

In Selection Range =
VAR currStart =
    MIN ( Table[Section Start] )
VAR currEnd =
    MAX ( Table[Section End] )
RETURN
    IF (
        currStart IN ALLSELECTED ( Calendar[Date] )
            && currEnd IN ALLSELECTED ( Calendar[Date] ),
        "Y",
        "N"
    )

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors