Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Good afternoon guys, how are you? I'm having a problem with a DAX function I've made:
First I made an Index that would return me 1 if a purchase had been made within a range of 8W:
1 - I8W = IF(
The second formula sums I8W over the 8-week interval:
However, when I segment the data by month, the metric only returns the sum of the selected month, excluding the previous month.
I would like it to return August + July in the data segmentation when I check the August option, like this way without having to check the 2 boxes or when I select the month in a graph
Can anyone give me some help/insight with this?
Thank you very much and Merry Christmas to all! 🙂
Solved! Go to Solution.
Hi,
Try this approach.
Measure = calculate(sum(table[Net sales volume]),datesbetween(calendar[date],max(calendar[date])-55,max(calendar[date])))
Hope this helps.
It worked!!!!
@Ashish_Mathur, thank you so much!!! I've been thinking about this for days.
Can you tell me why? Why do we have this difference in Value with Dcalendario vs TableData?
Cheers, Merry Christmas!!!
You are welcome. For any date calculation, creation of a Calendar Table is a must. Creation of a Calendar Table, allows usage of the Date intelligence functions.
Hi,
Try this approach.
Measure = calculate(sum(table[Net sales volume]),datesbetween(calendar[date],max(calendar[date])-55,max(calendar[date])))
Hope this helps.
User | Count |
---|---|
97 | |
73 | |
69 | |
43 | |
23 |