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

Get value of date slicer and filter all dates pre selected date

Hi there

Is there a way to get date value of a slicer and filter the table accordingly?
I have a date range slicer ( Periods[date] ).  Now the measure should count all values, where Cred[closed] is later than selected date in slicer. MIN and MAX obviously wouln't work as it ignores the set filter.

 

Measure =
VAR OpenValue = MIN(Cred[open]) // it's either 1 or 0
VAR ClosedDate = MIN(Cred[closed]) // date value
VAR SlicerDate = MAX(Periods[date]) // date range
RETURN
IF(OpenValue = 1 || ClosedDate > SlicerDate, 1, 0)
 
In the end I want to show values that are either open = 1 or Cred[closed] date is later than selected date value in slicer.
 
I hope there is an easy solution to this, many thanks.
 
best,
 
2 REPLIES 2
jaweher899
Impactful Individual
Impactful Individual

You can modify your measure as follows to achieve the desired result:

Measure = VAR SlicerDate = MAX(Periods[date]) // date range selected in slicer RETURN CALCULATE( SUM(Cred[value]), FILTER( Cred, Cred[open] = 1 || Cred[closed] > SlicerDate ) )

This measure will return the sum of the "value" column in the "Cred" table, filtered based on the conditions in the FILTER function. The FILTER function will return only the rows where the "open" column is equal to 1 or the "closed" column is greater than the selected date in the slicer (SlicerDate).

Note that you may need to modify the measure to match your exact requirements. I hope this helps!

Hi @jaweher899
Thanks for helping me. I've cleaned and translated my BI for better understanding as your solution isn't quite what I'm looking for I think.
In this case, the first value '-4677.15' should return 1 in Measure 2. As date filter is til 01.01.2023 and its closed date is 01.02.2023. So first row should be 1 while all other 0 (as they are not open nor date is earlier than "closed")

Castorx_0-1676282515178.png

 

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