Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi!
I am trying to calculate a 12 month cummulative sum of some values. I am using the formula:
=CALCULATE(
sum([WON]);
DATESBETWEEN(Table1[date];
dateadd(Table1[date];-1;YEAR);
Table1[date]))
Where fecha is a Date formated column in my dataset.
It's not working; datesbetween function doesn't seem to filter the dates and only retieves the same value all the time. Dateadd does work and refer to the Y-1 date.
I've tried this same formula in other dataset and it seems to do the trick. I've checked the date format in case it was a regional configuration issue and doesn't seem to be a problem. What can be wrong? I am getting the data via MySQL connector service but it shouldn't be a problem, should it?
I'll appreciate any help!
Javier
@Anonymous
For any time intelligence function, you could implement a custom DAX formula.
https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/
To avoid circular dependency error, see post below as an example.
It worked as a variable, thouhgh not in a row level. Will try some iterator functions!
Hi @Anonymous
Use DATESINPERIOD DAX function rather than DATESBETWEEN.
Try this:
=CALCULATE(
sum([WON]);
DATESINPERIOD(Table1[date];
MAX(Table1[date]);-1;YEAR)
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thanks @VahidDM !!
Now it seems to show a circular dependence error. How can this be?
@Anonymous
Can you share a sample of your file [PBIX] after emoving sensetive data?
Appreciate your Kudos!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |