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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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