The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |