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
MarieJ
Regular Visitor

how to get min & max date from date slider and make it as filter value?

 Hello, genius!

 

I have some problems like below,

I want to make "From Date"  and "To Date" from Date slider as filter value.

But once I want to make them as filter values, it doesn't work.

 

Inventory($) is Sum of Inventory between Date slider.

F.D Inv($) should be Sum of Inventory at only From Date (12/26/2016),

but it's the same as Inventory($) between Date slider.

T.D Inv(S) should be Sum of Inventory at only To Date (12/18/2017),

but it's the same as Inventory($) between Date slider.

 

The measure formulas are like below red lines.

why does this happen? T.T

 image.png

 

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @MarieJ,

 

Here I made a test to meet your requirement.
At first, create a dimtime table using DAX below and create relationship between table1 and dimtime table.

 

Dimtime = CALENDARAUTO()

 

Then create the measures in table1 as below:

 

from Date = CALCULATE(MIN(Dimtime[Date]),ALLSELECTED(Dimtime[Date]))
To Date = CALCULATE(MAX(Dimtime[Date]),ALLSELECTED(Dimtime[Date]))
T.D Inv($) = CALCULATE(SUM(Table1[Inventory]),FILTER(ALLSELECTED(Table1[Date]),Table1[Date]=[To Date]))
F.D Inv($) = CALCULATE(SUM(Table1[Inventory]),FILTER(ALLSELECTED(Table1[Date]),Table1[Date]=[from Date]))

 

Then we can create date slicer using date field of dimtime table and get the result as below.

 

1.PNG

 

For more information, please check the pbix as attached.

 

https://www.dropbox.com/s/0xqnma3e45moifx/how%20to%20get2.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @MarieJ,

 

Here I made a test to meet your requirement.
At first, create a dimtime table using DAX below and create relationship between table1 and dimtime table.

 

Dimtime = CALENDARAUTO()

 

Then create the measures in table1 as below:

 

from Date = CALCULATE(MIN(Dimtime[Date]),ALLSELECTED(Dimtime[Date]))
To Date = CALCULATE(MAX(Dimtime[Date]),ALLSELECTED(Dimtime[Date]))
T.D Inv($) = CALCULATE(SUM(Table1[Inventory]),FILTER(ALLSELECTED(Table1[Date]),Table1[Date]=[To Date]))
F.D Inv($) = CALCULATE(SUM(Table1[Inventory]),FILTER(ALLSELECTED(Table1[Date]),Table1[Date]=[from Date]))

 

Then we can create date slicer using date field of dimtime table and get the result as below.

 

1.PNG

 

For more information, please check the pbix as attached.

 

https://www.dropbox.com/s/0xqnma3e45moifx/how%20to%20get2.pbix?dl=0

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Oh My God! 

You're the genius to save my days!

Thank you so much!!

 

The problem was "ALLSELECTED"!!

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
Top Kudoed Authors