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
soldous
Advocate II
Advocate II

Measure based on dynamic date range from two dropdown slicers

Greetings DAX masters,

 

I have an issue which I don't know how to solve. I need to create a measure which will calculate sum of volume between two dates. But these dates I need to be dynamic based on two dropdown slicers: start date, end date. 

 

Is it possible? Could you please help with some general syntax to solve this?

Thanks in advance

 

1 REPLY 1
Anonymous
Not applicable

Hi

 My recommendation will be to have two calendar tables which do not have an active relationship to your start schema

Calendar1

Calendar2

Add a Slicer using Calendar1

Add another Slicer using Calendar2

 

Here is the calculated measure

calculated measure =

var _StartDate = max(Calendar1[Date])

var _EndDate = max(calendar2[Date])

return calculate(sum(dax expression), DATESBETWEEN(Calendar[DateKey], _StartDate , _EndDate  ))

 

Please let me know if this help

Tomas

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.

Top Solution Authors