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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
19harshav
New Member

filter Dates column in Date table based on measures and custom logic

Hello,

I am a begineer in power Bi and i need your help in achieving a task.

currently I have tables Date and Sales, Sales table is joined to Date table usingmDate column inside Date table and Sales_date in Sales table.

I added slicers for year , month and quarter column from Date table and based on the selected values I created four measures with some logic.

1. Start_date_minYear
2.end_date_minyear
3 Start_date_maxYear
4.enddate_maxyear

what i want is to filter the Date column from Date table using condition that the Dates should fall betweenn
( Start_date_minYear and end_date_minyear) || date should fall between  (Start_date_maxYear and enddate_maxyear)so that when i display a bar chart it should only show sales for filtered dates


please guide me how to achieve this

edit: added additional information

I have attached the two tables (Dates and Sales) data in these spreadsheets. I have slicers for year, Month and Quarter. so based on the slicer selection my values in 4 measures will be updated acordingly. for example if i choose years as 2022 and 2023,quarter as 3 and month as August then my four measures looks like this:
 
Startdate_prev_year: 2022-08-01
enddate_prev_year: 2023-08-18
Startdate_current_year: 2023-08-01  
enddate_current_year: 2023-08-18
 
i want to somehow apply these measures as filters on Date column so that my sales amounts will show the amounts in this range.
 
I dont want to create measure that calculates sum using the above measures, i want to have the dates filterd on visuals.
 
link to spreadsheets: files



3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

What is the end objective?  Why do you want to sum sales between pairs of dates?  Share data in a format that can be pasted in an MS Excel file and show the expected result.


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

Thanks, I have, added the requested information. Please have a look

Hi,

I don't think i can help you with this.  Perhaps because i do not understand your question.  Someone else will help you.


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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors