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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GregGiamz
Helper I
Helper I

How to hide cumulative bars if null/blank

Hi all,

 

I'm currently working on this chart, and as Q3 and Q4 data are not in yet, is there a way I can hide the Q3 and Q4 dark blue bars?

GregGiamz_0-1689930806226.png

 

This is the simplified dataset:

DateQ1Q2Q3Q4
realized 8020NULLNULL
forecasted68927374


I had used the 'running total' quick measure to get the cumulative totals, and this was the resulting formula for 'realized' chart:

CALCULATE(

    SUM(Realized),

    FILTER(

        CALCULATETABLE(

            SUMMARIZE('Calendar', 'Calendar'[CurrentDayOffset], 'Calendar'[Date]),

            ALLSELECTED('Calendar')

        ),

        ISONORAFTER(

            'Calendar'[CurrentDayOffset], MAX('Calendar'[CurrentDayOffset]), DESC,

            'Calendar'[Date], MAX('Calendar'[Date]), DESC

        )

    )

)

 

Any help would be appreciated, thank you!
 

 

1 ACCEPTED SOLUTION
Kishore_KVN
Super User
Super User

Hello @GregGiamz ,

Please ignore blanks during the calculation. Your measure should look as below:

If(IsBlank(Realized),Blank(),

CALCULATE(

    SUM(Realized),

    FILTER(

        CALCULATETABLE(

            SUMMARIZE('Calendar', 'Calendar'[CurrentDayOffset], 'Calendar'[Date]),

            ALLSELECTED('Calendar')

        ),

        ISONORAFTER(

            'Calendar'[CurrentDayOffset], MAX('Calendar'[CurrentDayOffset]), DESC,

            'Calendar'[Date], MAX('Calendar'[Date]), DESC

        )

    )
)

 

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

View solution in original post

1 REPLY 1
Kishore_KVN
Super User
Super User

Hello @GregGiamz ,

Please ignore blanks during the calculation. Your measure should look as below:

If(IsBlank(Realized),Blank(),

CALCULATE(

    SUM(Realized),

    FILTER(

        CALCULATETABLE(

            SUMMARIZE('Calendar', 'Calendar'[CurrentDayOffset], 'Calendar'[Date]),

            ALLSELECTED('Calendar')

        ),

        ISONORAFTER(

            'Calendar'[CurrentDayOffset], MAX('Calendar'[CurrentDayOffset]), DESC,

            'Calendar'[Date], MAX('Calendar'[Date]), DESC

        )

    )
)

 

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.