Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Syndicate_Admin
Administrator
Administrator

Cumulative Total with multiple filter selection

I have a database containing dates from different years and 7 projects (which are segmented by different types) of which, I need to generate a table containing:
1. Income

2. Expenses

3. Income - Expenses

4. Accumulated of the total that gives (Income - Expenses)
EXAMPLE:

Karla_Trejo_3-1692055629102.png

I already managed to do all the previous steps, but I have certain points that do not manage to stay.
1. When generating the table at a glance, in January of each year the accumulated is restarted and I do not want it to do that.
EXAMPLE:

Karla_Trejo_0-1692055325039.png

2. When you filter it for a single project there is (OK) the accumulated, it does not restart and the accumulated is correct.

EXAMPLE:

Karla_Trejo_1-1692055417204.png

3. When I filter 1 or more projects, the accumulated is no longer done correctly and in some games it does not mark any result and I need to call the consecutive accumulated regardless of the project or the date.

EXAMPLE:

Karla_Trejo_2-1692055459882.png

Within Power BI, I have the following calculated fields:

EGRESO = CALCULATE(SUM(FLUJOSPROYPRUEBA[Amount]),'FLUJOSPROYPRUEBA'[Type of Operation]= "Graduation")
INCOME = CALCULATE(SUM(FLOWSPROYTEST[Amount]),'FFLOWSPROYTEST'[Type of Operation]= "Income")
I-E = [All.General]
Tot.General = ('Tablas_medida'[INCOME]-'Tablas_medida'[EGRESO])
Cumulative 1 =
WHERE SelectedCategory = SELECTEDVALUE('FFLOWSPROYPRUEBA'[Project])
RETURN
IF(
ISFILTERED('FLUJOSPROYPRUEBA'[Project]),
CALCULATE(
SUM('FLUJOSPROYPRUEBA'[I-E]),
FILTER(
ALL('FLUJOSPROYPRUEBA'),
'FFLOWSPROYPRUEBA'[Date] <= .MAX('FLUJOSPROYPRUEBA'[Close]) &&
'FLOWSPROYTEST'[Project] = SelectedCategory
)
),
TOTALYTD(SUM('FLUJOSPROYPRUEBA'[I-E]), 'FLUJOSPROYPRUEBA'[Close], ALL('FLOWSPROYTEST'[Date]))
)

Is there any way to make the accumulated do not break in time or with multiple selections of projects?, if so could you help me know? Thank you.

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Nice day!
Try to place what you tell me and it does not work for me, could you be more specific?
or can you help me find another solution?


Thank you

parry2k
Super User
Super User

@Syndicate_Admin change this part, although when you are working dates, you should have date dimension in your model.

 

CALCULATE ( SUM('FLUJOSPROYPRUEBA'[I-E]), FILTER ( ALL ( Table[Date] ), Table[Date] <= MAX ( Table[Date] ) ) )

 

👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors