Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I am trying to calculate TTM for count for each row in the following case and I am not sure what formula should I use
| Count | YearQtr | YearQtr-1 | YearQtr-2 | YearQtr-3 | TTM |
| 100 | 2022-Q4 | 2022-Q3 | 2022-Q2 | 2022-Q1 | 1000 |
| 200 | 2022-Q3 | 2022-Q2 | 2022-Q1 | 2021-Q4 | 1400 |
| 300 | 2022-Q2 | 2022-Q1 | 2021-Q4 | 2021-Q3 | 1800 |
| 400 | 2022-Q1 | 2021-Q4 | 2021-Q3 | 2021-Q2 | |
| 500 | 2021-Q4 | 2021-Q3 | 2021-Q2 | 2021-Q1 | |
| 600 | 2021-Q3 | 2021-Q2 | 2021-Q1 | 2020-Q4 |
Solved! Go to Solution.
Hi @ghanta
try to add a column with this:
TTM2 =
VAR _a=[YearQtr]
VAR _b=[YearQtr-1]
VAR _c=[YearQtr-2]
VAR _d=[YearQtr-3]
RETURN
SUMX(
FILTER(
TableName,
TableName[YearQtr] IN {_a, _b, _c, _d}
),
TableName[Count]
)
i tried and it worked like this:
Hi @ghanta
try to add a column with this:
TTM2 =
VAR _a=[YearQtr]
VAR _b=[YearQtr-1]
VAR _c=[YearQtr-2]
VAR _d=[YearQtr-3]
RETURN
SUMX(
FILTER(
TableName,
TableName[YearQtr] IN {_a, _b, _c, _d}
),
TableName[Count]
)
i tried and it worked like this:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.