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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PauloH
Frequent Visitor

Filter by Key Date - data with start and end dates

Hi,

 

I have a database with multiple tables that contain start and end date for employee details, I want to allow users to select a key date and display the data that the date falls into. What's the best way to go about this?

 

Say we have:

 

Employees

-- Employee Unique ID

-- Name

 

Position

-- Employee Unique ID

-- Position Title

-- Employment Status

-- Start Date

-- End Date

 

Performance Score

-- Employee Unique ID

-- Score

-- Start Date

-- End Date

 

Thanks!

2 ACCEPTED SOLUTIONS
CahabaData
Memorable Member
Memorable Member

in general the method for user selection is via the Slicer;  some good video tutorials on using these.  You can have multiple within a page of a report.  So I would first check out that information.  

 

I can understand the idea of "slicing & dicing" data sets - but have always thought a more accurate name would be a Filter Selector......

 

make your first stab with these and then post if you need further assist.

 

 

www.CahabaData.com

View solution in original post

Eric_Zhang
Microsoft Employee
Microsoft Employee


@PauloH wrote:

Hi,

 

I have a database with multiple tables that contain start and end date for employee details, I want to allow users to select a key date and display the data that the date falls into. What's the best way to go about this?

 

Say we have:

 

Employees

-- Employee Unique ID

-- Name

 

Position

-- Employee Unique ID

-- Position Title

-- Employment Status

-- Start Date

-- End Date

 

Performance Score

-- Employee Unique ID

-- Score

-- Start Date

-- End Date

 

Thanks!


@PauloH

You can create a independent calendar table used in the slicer and create a measure as

isShown = 
IF (
    ISFILTERED ( 'calendar'[Date] ),
    IF (
        MAX ( 'calendar'[Date] ) >= MAX ( Table1[start date] )
            && MAX ( 'calendar'[Date] ) <= MAX ( Table1[end date] ),
        1,
        BLANK ()
    ),
    1
)

Capture.PNGCapture2.PNG

 

To filter data, you can use a filter like

FILTER(yourTable, yourTable[start date]<= MAX(calendar[date])&&yourTable[end date]>= MAX(calendar[date]))

See the attached pbix file.

View solution in original post

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee


@PauloH wrote:

Hi,

 

I have a database with multiple tables that contain start and end date for employee details, I want to allow users to select a key date and display the data that the date falls into. What's the best way to go about this?

 

Say we have:

 

Employees

-- Employee Unique ID

-- Name

 

Position

-- Employee Unique ID

-- Position Title

-- Employment Status

-- Start Date

-- End Date

 

Performance Score

-- Employee Unique ID

-- Score

-- Start Date

-- End Date

 

Thanks!


@PauloH

You can create a independent calendar table used in the slicer and create a measure as

isShown = 
IF (
    ISFILTERED ( 'calendar'[Date] ),
    IF (
        MAX ( 'calendar'[Date] ) >= MAX ( Table1[start date] )
            && MAX ( 'calendar'[Date] ) <= MAX ( Table1[end date] ),
        1,
        BLANK ()
    ),
    1
)

Capture.PNGCapture2.PNG

 

To filter data, you can use a filter like

FILTER(yourTable, yourTable[start date]<= MAX(calendar[date])&&yourTable[end date]>= MAX(calendar[date]))

See the attached pbix file.

CahabaData
Memorable Member
Memorable Member

in general the method for user selection is via the Slicer;  some good video tutorials on using these.  You can have multiple within a page of a report.  So I would first check out that information.  

 

I can understand the idea of "slicing & dicing" data sets - but have always thought a more accurate name would be a Filter Selector......

 

make your first stab with these and then post if you need further assist.

 

 

www.CahabaData.com

This had no relevant info to the question - not a solution

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.