Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
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
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
9 | |
6 |