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
KaranMane
New Member

How to Find the records between two columns which are start date and end date

there is another column which is named as status (which contains active and closed status). I want the status which are in the range of dates which i picked by slicer date picker.

 

Note : there are two separate column for start date and end date. and after selecting the dates in slicer then status should be filtered out.

IMG_20221123_131237~2.jpg

IMG_20221123_131328.jpg

  Thank you in advance 

2 ACCEPTED SOLUTIONS
v-yadongf-msft
Community Support
Community Support

Hi @KaranMane ,

 

This is my test table:

vyadongfmsft_0-1669260072001.png

 

Please create a calendar table:

CalendarTable = ADDCOLUMNS(CALENDAR(MIN('Table'[Start date]),MAX('Table'[End date])),"Month",MONTH([Date]))

vyadongfmsft_1-1669260119016.png

 

Relationship:

vyadongfmsft_2-1669260154247.png

 

Create a slicer from calendar table:

vyadongfmsft_3-1669260192552.png

 

I think you will get the result you want:

vyadongfmsft_4-1669260223112.png

vyadongfmsft_5-1669260249189.png

Best regards,

Yadong Fang

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

Ashish_Mathur
Super User
Super User

Hi,

The ideal approach should be to create one row for each date between the start and end date.  This however may lead to a lot of rows being created.  We can reduce the table size by creating one row for each month between the start and end date.  This will allow you to select only one/multiple months (not random dates).  Are you OK with selecting months in a slicer rather than a specific date range?


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

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

The ideal approach should be to create one row for each date between the start and end date.  This however may lead to a lot of rows being created.  We can reduce the table size by creating one row for each month between the start and end date.  This will allow you to select only one/multiple months (not random dates).  Are you OK with selecting months in a slicer rather than a specific date range?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yadongf-msft
Community Support
Community Support

Hi @KaranMane ,

 

This is my test table:

vyadongfmsft_0-1669260072001.png

 

Please create a calendar table:

CalendarTable = ADDCOLUMNS(CALENDAR(MIN('Table'[Start date]),MAX('Table'[End date])),"Month",MONTH([Date]))

vyadongfmsft_1-1669260119016.png

 

Relationship:

vyadongfmsft_2-1669260154247.png

 

Create a slicer from calendar table:

vyadongfmsft_3-1669260192552.png

 

I think you will get the result you want:

vyadongfmsft_4-1669260223112.png

vyadongfmsft_5-1669260249189.png

Best regards,

Yadong Fang

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

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.