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.
Hello everyone and please help
MY PROBLEM
In the table "TABLE1" I have the values "id" and "Value". The measure "Value n-1" calculates the value from the previous row of the table. The column "Differ" is a measure that calculates the difference between "Value" and "Value n-1". At the level of a single row in the table, everything is calculated correctly. However, I need to calculate the sum of differences from the column "Differ". The calculated value in the table "Table1" should be "10" but it is "37". The problem probably lies in the lack of a sum of values for the column "Value n-1". What am I doing wrong? Please help
Value n-1 =
var a =
CALCULATE(
max(TABLE1[id]);
FILTER(
ALLSELECTED(TABLE1[id]);TABLE1[id] < SELECTEDVALUE(TABLE1[id])
)
)
RETURN
CALCULATE(
SUMX(TABLE1;TABLE1[Value]);TABLE1[id] = a
)
Differ =
var a = TABLE1[Value n-1]
RETURN
sumx(TABLE1;TABLE1[Value] - a)
Solved! Go to Solution.
Try these measures:
Sum of Value = SUM ( Table1[Value] )
Value n-1 =
CALCULATE (
[Sum of Value],
OFFSET ( -1, ALLSELECTED ( Table1[id] ), ORDERBY ( Table1[id], ASC ) )
)
Differ = [Sum of Value] - [Value n-1]
Proud to be a Super User!
Try these measures:
Sum of Value = SUM ( Table1[Value] )
Value n-1 =
CALCULATE (
[Sum of Value],
OFFSET ( -1, ALLSELECTED ( Table1[id] ), ORDERBY ( Table1[id], ASC ) )
)
Differ = [Sum of Value] - [Value n-1]
Proud to be a Super User!
Thank you very much for your support
everything works fine
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 |
---|---|
24 | |
15 | |
9 | |
9 | |
9 |
User | Count |
---|---|
19 | |
15 | |
14 | |
13 | |
13 |