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.
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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
38 | |
31 | |
26 |