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.
HI All,
I am setting up a calculation group and am looking for ONE measure which gives me the running total of previous year. I cannot reference another cumulative measure and use SAMEPERIODLASTYEAR. So I only have the [total sales] measure which I want to refrence in the new cumulative last year measure.
I Want to accomplish this
Month | This year RT | Previous year RT |
1 | 2 | 4 |
2 | 5 | 6 |
3 | 7 | 8 |
4 | 9 | 9 |
5 | 11 | 11 |
6 | 14 | 12 |
7 | 17 | 15 |
8 | 19 | 18 |
9 | 30 | 22 |
Hope you can help me
Solved! Go to Solution.
A more specific expression can be provided with example data that has you Date and Sales Tables/Column, but you can get a PY RT with an expression like this. Note this assume you have a Date table, marked as a date table.
PY RT =
VAR vThisDate =
MAX ( Date[Date] )
VAR vPYThisDate =
EDATE (
vThisDate,
-12
)
VAR vPYStart =
DATE ( YEAR ( vPYThisDate ), 1, 1 )
VAR vResult =
CALCULATE (
[Total Sales],
FILTER (
ALL ( Date[Date] ),
Date[Date] >= vPYStart
&& Date[Date] <= vPYThisDate
)
)
RETURN
vResult
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
A more specific expression can be provided with example data that has you Date and Sales Tables/Column, but you can get a PY RT with an expression like this. Note this assume you have a Date table, marked as a date table.
PY RT =
VAR vThisDate =
MAX ( Date[Date] )
VAR vPYThisDate =
EDATE (
vThisDate,
-12
)
VAR vPYStart =
DATE ( YEAR ( vPYThisDate ), 1, 1 )
VAR vResult =
CALCULATE (
[Total Sales],
FILTER (
ALL ( Date[Date] ),
Date[Date] >= vPYStart
&& Date[Date] <= vPYThisDate
)
)
RETURN
vResult
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |