Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I've checked most of the forum posts regarding cumulative and running totals but none of them seem to be working with my report.
Date | In/Out | Tonnage |
1/04/2022 | In | 345 |
1/04/2022 | Out | 335 |
10/04/2022 | In | 355 |
11/04/2022 | In | 20 |
I currently have a line graph with the date on the X-Axis, and the tonnage on the Y-Axis. I want the tonnage to be running through cumunitavely (in for counting for plus tonnage, out counting for minus tonnage).
For example, 1/04/2022 will read as 10 on Y-Axis (345 - 335).
10/04/2022 will read as 365 on Y-Axis (10 + 355)
11/04/2022 will read as 385 on Y-Axis (365 + 20)
Any help will be appreciated 🙂
Solved! Go to Solution.
@alex9999
Please check the attached file:
Running Total =
VAR __Date = max( Dates[Date])
VAR __InTotal =
CALCULATE(
SUM(Table1[Tonnage]),
Table1[In/Out] = "IN",
'Dates'[Date] <= __Date,
ALLSELECTED( 'Dates' )
)
VAR __OutTotal =
CALCULATE(
SUM(Table1[Tonnage]),
Table1[In/Out] = "OUT",
'Dates'[Date] <= __Date,
ALLSELECTED( 'Dates' )
)
RETURN
IF( sum(Table1[Tonnage]) <> BLANK(),
__InTotal - __OutTotal
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@alex9999
Please check the attached file:
Running Total =
VAR __Date = max( Dates[Date])
VAR __InTotal =
CALCULATE(
SUM(Table1[Tonnage]),
Table1[In/Out] = "IN",
'Dates'[Date] <= __Date,
ALLSELECTED( 'Dates' )
)
VAR __OutTotal =
CALCULATE(
SUM(Table1[Tonnage]),
Table1[In/Out] = "OUT",
'Dates'[Date] <= __Date,
ALLSELECTED( 'Dates' )
)
RETURN
IF( sum(Table1[Tonnage]) <> BLANK(),
__InTotal - __OutTotal
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thank you, exactly what I was looking for! Great help 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
44 | |
32 | |
30 | |
18 | |
17 |