Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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:
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 64 | |
| 39 | |
| 33 | |
| 23 |