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,
Currently I have a column labled date that has all the dates from 2010 to 2030.
I have another columns with lengths for each of these dates.
I would like to get a running count of the length for up to the dates in 2014, and then every year after that up to the current year we are in I want to add 10.
This will be a line that gradually goes up in my chart.
Right now I have,
CALCULATE(SUM(table[goal])/5280,
Filter(AllSelected(table),YEAR(table[Date]) <= 2014, table[Date before prev month] <> BLANK()
) + (YEAR(TODAY()) - 2014) * 11
but this does not give me a line that gradually goes up.
Can someone point me in the right direction?
Hi @rchicas3 ,
To get a running count of the length for up to the dates in 2014, and then every year after that up to the current year we are in I want to add 10, you can use the following DAX formula:
Running Total =
VAR BaseYear = 2014
VAR CurrentYear = YEAR(TODAY())
VAR RunningTotal =
CALCULATE(
SUM(table[Length]),
FILTER(
ALL(table),
YEAR(table[Date]) <= BaseYear
|| YEAR(table[Date]) <= CurrentYear
&& YEAR(table[Date]) > BaseYear
)
)
RETURN
RunningTotal + (YEAR(TODAY()) - BaseYear) * 10
This formula first defines two variables, BaseYear and CurrentYear, which represent the years that define the start and end of the running total. The formula then calculates the running total by summing the lengths of all rows where the year is less than or equal to BaseYear, or where the year is less than or equal to CurrentYear and greater than BaseYear. Finally, the formula adds the difference between the current year and BaseYear multiplied by 10 to the running total.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
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 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |