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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
arimoldi
Resolver I
Resolver I

Waterfall Chart based on Status Variations and Dates

Hi,

 

I need to create a waterfall chart in Power BI based on a dataset like this:

 

REFERENCE_DATECODESTATUSSEVERITY
30/11/2024AONGOINGLOW
30/11/2024BONGOINGLOW
30/11/2024CONGOINGHIGH
31/12/2024AONGOINGLOW
31/12/2024BCLOSEDLOW
31/12/2024CONGOINGHIGH
31/01/2025AONGOINGLOW
31/01/2025CONGOINGMEDIUM
31/01/2025DONGOINGHIGH

 

and the expected final chart should be something like this:

arimoldi_0-1739436717408.png

 

So basically all the variations total count of CODEs, any variations of STATUS (every status to CLOSED) and any variations of SEVERITY (any decrease from from HIGH to LOW or MEDIUM) should be treated as -1, while the opposite as +1.

 

The waterfall chart should work according to a slicer based on REFERENCE_DATE, so if I select just 30/11/2024 and 31/01/2025 the chart should consider the variations between these 2 reference date.

 

Any suggestion on how to achieve the final result?

 

Thanks,

Andrea

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @arimoldi 

Based on your description,   you can refer to the following solution.

Sample data is the same as you provided.

1.Create a type table.

vxinruzhumsft_0-1739504318134.png

 

2.Create the following measures.

Level =
IF (
    SELECTEDVALUE ( 'Table'[STATUS] ) = "CLOSED",
    0,
    SWITCH ( SELECTEDVALUE ( 'Table'[SEVERITY] ), "HIGH", 3, "MEDIUM", 2, "LOW", 1 )
)
Define =
VAR a =
    MAXX (
        TOPN (
            1,
            FILTER (
                ALLSELECTED ( 'Table' ),
                [REFERENCE_DATE] < MAX ( 'Table'[REFERENCE_DATE] )
                    && [CODE] IN VALUES ( 'Table'[CODE] )
            ),
            [REFERENCE_DATE], DESC
        ),
        [Level]
    )
VAR b = [Level]
RETURN
    IF ( b = a || a = BLANK (), "Keep", IF ( b > a, "Upper", "Lower" ) )
Counts =
VAR a =
    ADDCOLUMNS ( ALLSELECTED ( 'Table' ), "Test", [Define] )
VAR b =
    COUNTROWS (
        FILTER (
            a,
            [Test]
                IN VALUES ( 'Type'[Type] )
                    && [REFERENCE_DATE] IN VALUES ( 'Table'[REFERENCE_DATE] )
        )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Type'[Type] ) = "Lower", 0 - b, b )

Then create a stacked Column visual, and put the following field to it.

vxinruzhumsft_1-1739504509845.png

Output

vxinruzhumsft_2-1739504532433.png

Best Regards!

Yolo Zhu

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

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @arimoldi 

Based on your description,   you can refer to the following solution.

Sample data is the same as you provided.

1.Create a type table.

vxinruzhumsft_0-1739504318134.png

 

2.Create the following measures.

Level =
IF (
    SELECTEDVALUE ( 'Table'[STATUS] ) = "CLOSED",
    0,
    SWITCH ( SELECTEDVALUE ( 'Table'[SEVERITY] ), "HIGH", 3, "MEDIUM", 2, "LOW", 1 )
)
Define =
VAR a =
    MAXX (
        TOPN (
            1,
            FILTER (
                ALLSELECTED ( 'Table' ),
                [REFERENCE_DATE] < MAX ( 'Table'[REFERENCE_DATE] )
                    && [CODE] IN VALUES ( 'Table'[CODE] )
            ),
            [REFERENCE_DATE], DESC
        ),
        [Level]
    )
VAR b = [Level]
RETURN
    IF ( b = a || a = BLANK (), "Keep", IF ( b > a, "Upper", "Lower" ) )
Counts =
VAR a =
    ADDCOLUMNS ( ALLSELECTED ( 'Table' ), "Test", [Define] )
VAR b =
    COUNTROWS (
        FILTER (
            a,
            [Test]
                IN VALUES ( 'Type'[Type] )
                    && [REFERENCE_DATE] IN VALUES ( 'Table'[REFERENCE_DATE] )
        )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Type'[Type] ) = "Lower", 0 - b, b )

Then create a stacked Column visual, and put the following field to it.

vxinruzhumsft_1-1739504509845.png

Output

vxinruzhumsft_2-1739504532433.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors