Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
10 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |