Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi everyone, I'm trying to sum the last 5 rows in a table for each row and divided by category, such as the example below that I did in Excel. The expected result is the column D 'RUNNING_SUM'.
If I would write this in SQL, I would use SUM OVER PARTITION.
Could you anwser that for me?
.Example in Excel how to do it
Solved! Go to Solution.
try like:
Coulmn =
VAR _fam = [Fam]
VAR _year = [YEAR]
RETURN
SUMX(
FILTER(
TableName,
TableName[Fam] = _fam
&&TableName[Year] >=_year-4
&&TableName[Year]<=_year
),
TableName[Value]
)
Hi @FreemanZ , I edited the post, but the expected result is the Column D 'RUNNING_SUM'.
try like:
Coulmn =
VAR _fam = [Fam]
VAR _year = [YEAR]
RETURN
SUMX(
FILTER(
TableName,
TableName[Fam] = _fam
&&TableName[Year] >=_year-4
&&TableName[Year]<=_year
),
TableName[Value]
)
That one was hard, congratulations, overwhelming 👏
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
27 | |
15 | |
11 | |
8 | |
8 |
User | Count |
---|---|
19 | |
15 | |
15 | |
14 | |
13 |