Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |