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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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/
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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