Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi guys,
I've a table like this
date | Type | Qty |
01/01/2024 | A | 2 |
01/01/2024 | B | -1 |
01/01/2024 | B | -8 |
01/01/2024 | B | -3 |
01/01/2024 | A | 9 |
01/01/2024 | A | 10 |
01/02/2024 | A | 5 |
01/02/2024 | B | -1 |
01/02/2024 | B | -2 |
01/03/2024 | A | 6 |
01/03/2024 | A | 7 |
01/03/2024 | B | -2 |
i need to calculate total A and total B for each month. The total of last month must be the inizial total of current month. For example:
In january the total is 9.
The initial value in february is 9 --> 9 + 5 - 3 = 11
The initial value in march is 11... etc etc
How Can i replicate this table?
Thank you all 🙂
Solved! Go to Solution.
Hi, @giuliapiazza94
Try below measure
Measure =
VAR a = SUMX(
FILTER(
ALLSELECTED(
'Table'[date],
'Table'[Qty]
),
'Table'[date] <= MAXX(
FILTER(
ALLSELECTED('Table'[date]),
'Table'[date] < MIN('Table'[date])
),
[date]
)
),
'Table'[Qty]
)
VAR b = SUM('Table'[Qty]) + a
RETURN
IF(
ISINSCOPE('Table'[Type]),
SUM('Table'[Qty]),
b
)
You can download .pbix file.
Best Regards,
Dangar
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @giuliapiazza94
Try below measure
Measure =
VAR a = SUMX(
FILTER(
ALLSELECTED(
'Table'[date],
'Table'[Qty]
),
'Table'[date] <= MAXX(
FILTER(
ALLSELECTED('Table'[date]),
'Table'[date] < MIN('Table'[date])
),
[date]
)
),
'Table'[Qty]
)
VAR b = SUM('Table'[Qty]) + a
RETURN
IF(
ISINSCOPE('Table'[Type]),
SUM('Table'[Qty]),
b
)
You can download .pbix file.
Best Regards,
Dangar
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.