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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Date filtering

Hi!

 

I'm relatively new to Power Bi and was having trouble with implementing a date filter. 

 

The task is to have a date filter that only show data that falls before but NOT including the selcted date. The before feature in the fiter date widget shows values on the selected date.

 

Is there a DAX command that can overide the filter and exclude values on the selected date?

 

Anything helps, thank you!!

1 ACCEPTED SOLUTION

Hi,

Please check the attached file.

I changed a relationship type.

 

Name measure: = 
CALCULATE (
    SELECTEDVALUE ( data[name] ),
    FILTER ( data, data[date] < MAX ( 'Calendar'[date] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

I tried to create a sample pbix file.

One of ways to solve this is to have disconnected calendar table.

 

Picture2.png

 

Sales total: =
CALCULATE (
    SUM ( Data[Sales] ),
    FILTER ( 'Calendar', 'Calendar'[Date] < MAX ( 'Calendar slicer'[Date] ) )
)

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Thank you for your help!
I just had a query, for the "Sales Total:" DAX command, how would that be altered if there wasn't anything to sum up. For example, if the chart was composed of peoples' name, date of birth or other values that are unable to be summed?

Hi,

Thank you for your feedback.

I think you can use other function, instead of SUM, for instance, selectedvalue / min / max / and so forth.

Please share your sample pbix file, and then more accurate solution can be written.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi,

 

I attached a sample file. I am having trouble replicating the solution you made. 

 

I appreciate the help, let me know if you have trouble accessing anything.

 

Thank you!

https://drive.google.com/file/d/1gNgU38EX6l7EDIuCryQm9bVyBxobe-Z8/view?usp=sharing 

 

Hi,

Please check the attached file.

I changed a relationship type.

 

Name measure: = 
CALCULATE (
    SELECTEDVALUE ( data[name] ),
    FILTER ( data, data[date] < MAX ( 'Calendar'[date] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi,

I was wondering how I would alter this measure to exclude the people who leave (have a status of -1) but include everyone with a status of 1 and only show the people before but not including the selected date?
I attached a sample power bi file.
https://drive.google.com/file/d/1gyRlYRIZ0KckVOvFBFm6s2tGEq8MvpHM/view?usp=sharing

Thank you!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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