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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Selected Value filter not working properly

Hello, I'd like to filter the start-end date of employee leave record based on a selected date. I'm using the following DAX but it seems to be not working. Please help.

 

SelectedDate = CALCULATE(SUM(Leave[ContactID]), 
FILTER(Leave,
SELECTEDVALUE('Calendar'[Date]) <= ALL(Leave[LeaveFrom])
&& SELECTEDVALUE('Calendar'[Date]) >= ALL(Leave[LeaveTo])
 ))

 

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To update your measure as below to have try. If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

SelectedDate =
CALCULATE (
    SUM ( Leave[ContactID] ),
    FILTER (
        Leave,
        SELECTEDVALUE ( 'Calendar'[Date] ) <= Leave[LeaveFrom]
            && SELECTEDVALUE ( 'Calendar'[Date] ) >= Leave[LeaveTo]
    )
)
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi @v-frfei-msft 

 

Thank you so much for replying.

I have one table which contains employee leave data, typically it contains employee name, leave start and leave end date. I have two other tables, contains project and user's timesheet information. 

 

What I wanted is to filter the user's timesheet and its leave information based on the date selection from the Calander table.

 

For example: if a user is going on leave from 4th Mar - 20th Mar, and If I select 15th Mar from the calendar, I should be able to see leave information of that particular user on that selected date along with all the planned task he has been assigned to that date.

 

Here is the link to the power bi file: https://1drv.ms/u/s!AkX-WgOcYFxrh0ylE2BQtYvcKfsr

and see Page 1.

 

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.