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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gvg
Post Prodigy
Post Prodigy

How to create measure for waterfall chart that begins with previous month balance

Hi folks,

 

I have a table of unregular day cash in and outflows for a few years. How do I create a measure for waterfall chart that begins with previous month balance, then showing increases/decreases for every day of the filtered month, ending with the balance at the end of the filtered month? My table looks like this:

 

Date                   CashFlow

-------                -----------

2016-Jan-1              100

2016-Jan-2              -40

2016-Mar-3             -20

2017-Feb-20           200

2017-Feb-25           120

2017-Feb-26           -30

 

If current filtered month is 2017-Feb, the waterfall chart I would expect to chart:

40    200  120  -30    330

 

where 40 is the sum of all cash flows prior to 2017-Feb-1.

 

 

 

1 ACCEPTED SOLUTION

@gvg,

 

I've modified the .pbix. Please check again.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-chuncz-msft
Community Support
Community Support

@gvg,

 

You may refer to the following DAX.

Measure =
IF (
    MAX ( Table1[Date] )
        = CALCULATE ( MIN ( Table1[Date] ), ALLSELECTED ( Table1 ) ),
    CALCULATE (
        SUM ( Table1[CashFlow] ),
        FILTER ( ALL ( Table1[Date] ), Table1[Date] <= MAX ( Table1[Date] ) )
    ),
    SUM ( Table1[CashFlow] )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft

 

Well, this returns just one value 330 instead of all five. Nothing to chart. But thanks for the tip.

@gvg,

 

Please check the .pbix attached.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks  @v-chuncz-msft.

 

This is very close to what I am looking for. The only thing is that I want to be able to select month and have cash flows charted step by step during that month with the beginning of month and end of month values. However, when I select month ( I made my own Calendar that includes months), it doesn't chart the initial beginning balance.

 

 

Waterfall.png

@gvg,

 

I've modified the .pbix. Please check again.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yep, that is exactly what I was looking for. Thanks @v-chuncz-msft !

gvg
Post Prodigy
Post Prodigy

Hi again,

 

It looks like this measure works only if there is no relationship between Date fields. How to modify the measure so that it works when Table1 and Calendar fields are related through the Date field?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.