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! Learn more

Reply
TristanKuesters
Resolver I
Resolver I

Date filter based on slicer date filter

Hello everybody,

 

it is time for a new challenge.

 

The scenario:

-----

I wanted to know the sales amount from our collegues based on a specific date range.

 

The date range will be defined by a Sprint (Scrum methodology) of 3 weeks.

So filter on Sprint 98 filter the date to 06th march to 26th march.

 

The hours spend for a specific collegues ales tracked in a fact table. A simpel sum(table[hours]) get what I need for the above mentoined three weeks. Lets say 80 hours.

 

On the other hand I have a sales amount of 1000 € with a posting date of 31th of march.

-----

Soo.. what I think about is the following:

 

Lets get the total hours for the complete march for this collegue, lets say 100 hours, divide them then against the 1000€ - and then we have the sales price per hours. Last step is to multiply the 80 hours for the above mentoined sprint with the sales price of 10€. Result will be 800€ sales amount for this collegue.

---

But of course my challenge is to ignore the initial date filter, and set for a measure a new date filter for march. How can I do this?

 

And 2nd step: What, wenn the sprint 99 is from 27th march to 16th of april? Now I have a bigger datefilter about two month..

 

So, any comment or question are welcome!

 

Best regards, Tristan

 

1 ACCEPTED SOLUTION

Hello Xiaoxin,

 

thanks for your answer. Sometime the solution is so simple.

The only adjustment I made to get the complete month is the following:

Calculate based on slicer = 
var SelectDateMin=FIRSTOFMONTH(ALLSELECTED('Table'[Date]))
var SelectDateMax=LASTOFMONTH(ALLSELECTED('Table'[Date]))
return
CALCULATE(formula, FILTER(ALL('Table'),[Date]>=SelectDateMin&&[Date]<=SelectDateMax))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @TristanKuesters,

 

>>But of course my challenge is to ignore the initial date filter, and set for a measure a new date filter for march.
It is simply to use "all/allselected" function to ignore the default date filter.

 

About the new data filter, you can add a slicer on data column, then combination use  "allselected" with "firstdate/lastdate" to get the min and max date.

Sample measure:

 

Calculate based on slicer = 
var SelectDateMin=FIRSTDATE(ALLSELECTED('Table'[Date]))
var SelectDateMax=LASTDATE(ALLSELECTED('Table'[Date]))
return
CALCULATE(formula, FILTER(ALL('Table'),[Date]>=SelectDateMin&&[Date]<=SelectDateMax))

 

 

Notice: "formula" part means the calculation of your formula.

 

If above is not help, please share some sample data to test.

 

Regards,

Xiaoxin Sheng

Hello Xiaoxin,

 

thanks for your answer. Sometime the solution is so simple.

The only adjustment I made to get the complete month is the following:

Calculate based on slicer = 
var SelectDateMin=FIRSTOFMONTH(ALLSELECTED('Table'[Date]))
var SelectDateMax=LASTOFMONTH(ALLSELECTED('Table'[Date]))
return
CALCULATE(formula, FILTER(ALL('Table'),[Date]>=SelectDateMin&&[Date]<=SelectDateMax))

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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