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
MIB
Frequent Visitor

Filtering multiple date columns by only one interval filter.

Hi everyone!

 

So, I'm having some serious problems to filter 3 columns with only one "between dates" filter. 

 

I have this sheet, that brings me the Product code and its movents: sold, returned, Demolished.

 

PBI EX 1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

For the example I brougth only 3 columns of product movments but I have like 6 types of movemnts, just for you to know. What I want is to filter all the movments that had hapen in an interval between two dates.

 

Lets say I want to see all the movments in the interval of 18/05/2018 to 20/05/2018 (Day/Month/Year):

 

 

So I want my filter, to bring me all the products that had some movment on between thoose dates, like this:

PBI EX 2.png

 

So each row has at least one date. And if at least one of thoose is in insade the inerval I want to see the product.In thee case I'd like to see the rows: 

 

PBI EX 3.png

 

I've tried to:

> Merge the tree columns and filter them as a string, on the report and page level filter, but it only works for a one day interval, since the column that I get  gives me something like: "14/05/2018 ; 17/05/2018 ; 20/05/2018" for each row...

 

>Tried to create a calendar Query, relate all the three columns and then try to filter as a visual/report level, didt worked.

 

>Tried to create two columns that would give me the max and minumun dates of each row, then filter by thoose two columns using the inerval between tthem, min and max. Theese one is only an idea, I wasnt even able to get the maximum value os date in each row.

 

So can somebody help me? what a want is kind of a "Ctrl - F" in excel, but instead of finding only one value at time, it would bring me all the values thats find between two given bu user dates.

 

Important questions: 

> Can I have something similar to "Console.ReadLine()" of C# in PBI? Only a filed to read two dates of the user, simple input thats all.

 

> If I can have input. Im making a conection with a DataBase, Just brought it to an excel to be easier to explain. can I send this user input to a "select". So I'd get the two dates from the user, and somehow send it to the query Im using to take the data from the base so that it would already bring me the correct product movements that a want?

 

Thanks in advace, this thing is really a challenge rs I'm a trainee in a pretty big Brazilian company and no one that I know has been abble to solve it. 

1 ACCEPTED SOLUTION
MIB
Frequent Visitor

I was abble to solve the problem  by getting the maximum and minum values between the movemnt dates. Aftar i took those, i could filter the rows using a "After" on the maximum and a "Before" on the minimun. 

View solution in original post

2 REPLIES 2
MIB
Frequent Visitor

I was abble to solve the problem  by getting the maximum and minum values between the movemnt dates. Aftar i took those, i could filter the rows using a "After" on the maximum and a "Before" on the minimun. 

How about you unpivot the data so you have  3 columns

product, date, movement type

 

then you can just put a filter on the date column. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.