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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
joshrumbawa
Frequent Visitor

Filter 2 dates column in 1 table

Hello PBI Experts,


I have a requirements to filter the fact table based from Date Dim table. I have 2 dates column to consider the Application Date and the Approved date.

In my datamodel, the date is connected to the Application date. However, they require me to include the record from Approved Date. 

For Ex. I filter the dates from Feb 1 - Feb 29. The result will show all the records that covers from that range based from Application Date and Approved Date.

joshrumbawa_0-1709895554527.png

I tried to search, and so far there's 2 option

1. Is to create a INACTIVE connection in a datamodel, then use the USERELATIONSHIP in DAX.
2. Is to create DAX that will create a flag if the date range condition met then put the flag on each chart.

I tried both, but it's not suitable to my requirements. 
Is there a workaround in a datamodel? or someone encounter same scenario?

In SQL, this can be done using WHERE Application Date OR Approved Date clause.

Please help I got stuck on this issue. Thank you in advance! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @joshrumbawa 

 

First of all, thanks to @lbendlin and @Wilson_ for your timely reply.

 

Here is the test I did.

 

My sample:

vxuxinyimsft_0-1710122241009.png

 

vxuxinyimsft_1-1710122259556.png

 

There is no relationship between the two tables.

vxuxinyimsft_2-1710122302905.png

 

Create a measure:

Measure = IF(MAX([Application Date]) >= MIN('Date'[Date]) && MAX([Application Date]) <= MAX('Date'[Date]) || MAX([Approved Date ]) >= MIN('Date'[Date]) && MAX([Approved Date ]) <= MAX('Date'[Date]), 1, 0)

 

Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_3-1710122417932.png

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @joshrumbawa 

 

First of all, thanks to @lbendlin and @Wilson_ for your timely reply.

 

Here is the test I did.

 

My sample:

vxuxinyimsft_0-1710122241009.png

 

vxuxinyimsft_1-1710122259556.png

 

There is no relationship between the two tables.

vxuxinyimsft_2-1710122302905.png

 

Create a measure:

Measure = IF(MAX([Application Date]) >= MIN('Date'[Date]) && MAX([Application Date]) <= MAX('Date'[Date]) || MAX([Approved Date ]) >= MIN('Date'[Date]) && MAX([Approved Date ]) <= MAX('Date'[Date]), 1, 0)

 

Put the measure into the filter so that the visual only shows data where the measure is equal to 1.

vxuxinyimsft_3-1710122417932.png

 

Best Regards,
Yulia Xu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Wilson_
Super User
Super User

Hi joshrumbawa,

 

I'm curious why you say it's not sustainable for your requirements. Can you elaborate? It seems the second option you listed should be the most straightforward approach. As @lbendlin says, you cannot have multiple active relationships at the same time.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





lbendlin
Super User
Super User

With the standard data model you have two options

 

- AND - filter on both columns, filters will overlay

- EITHER OR - employing USERELATIONSHIP you can switch the filter between the columns

 

What you want is OR - that is not supported in the default data model.  It requires disconnected tables to feed your slicers/filters, and measures as visual filters to apply the selections to the data model's fact table.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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