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
yoav20007
Helper II
Helper II

filter tables by range of dates

I have only 2 tables and i want when i filter the first table it will filter other table between dates that in the first table.

i conect then with many to many relationship (maybe my mistake?) .

if it is posible to create a new table from table 2 just with the row in the rage dates that i select from table 1?

 

table2.PNG

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Go to Data > Modelling > New Table and write this formula

=CALENDAR(MIN(Data[Planting Date]),MAX(Data[Harvest Date]))

Now build a relationship from the Date column of Table1 and Table2 to the Date column of the Calendar Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
yoav20007
Helper II
Helper II

now i can do it manually . but how can i creat new table with the results automaticly?  

table4.PNGtable3.PNG

Here is a lot to learn when you start out. You should not creat this many to many relationship (there are exceptions, but this is not one of them).  You need another table containing all the uniqueness values containing both columns that you are joining on, and join both to that. Read my article here

https://exceleratorbi.com.au/the-optimal-shape-for-power-pivot-data/

 

Then this one

https://exceleratorbi.com.au/power-pivot-calendar-tables/

 



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

Thanks 

I try to connect them to 3 table that have unique values, but i still have a problem to filter by date from the first table.

 

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.