Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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:
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 |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
39 |