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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Line Chart: Not showing Line when Zero

Hi. This is my first post.

 

I am trying to build the a combo bar and line chart. How do I NOT show the line that is Zero? Please see picture below. I want to stop the red line at Sep and don't show the zeros.

 

Thanks

 

Stop Here.JPG

3 ACCEPTED SOLUTIONS

Hi @Anonymous ,

It caused by brackets. Try this.

Actual Cumulative Adj =
IF (
    CALCULATE (
        SUM ( 'Fact Summary'[YTD Actuals] ),
        FILTER (
            ALLSELECTED ( 'DimDate'[FIN_YR_MONTH] ),
            ISONORAFTER ( 'DimDate'[FIN_YR_MONTH], MAX ( 'DimDate'[FIN_YR_MONTH] ), DESC )
        )
    ) = 0,
    BLANK (),
    CALCULATE (
        SUM ( 'Fact Summary'[YTD Actuals] ),
        FILTER (
            ALLSELECTED ( 'DimDate'[FIN_YR_MONTH] ),
            ISONORAFTER ( 'DimDate'[FIN_YR_MONTH], MAX ( 'DimDate'[FIN_YR_MONTH] ), DESC )
        )
    )
)

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

Hi @Anonymous ,

 

Try putting your previous formula in VAR

Actual Cumulative Adj =
VAR  ActualCumAdj =  
   CALCULATE(
       SUM('Fact Summary'[YTD Actuals]),
           FILTER(
               ALLSELECTED('DimDate'[FIN_YR_MONTH]),
               ISONORAFTER('DimDate'[FIN_YR_MONTH],         
                      MAX('DimDate'[FIN_YR_MONTH]),
                      DESC)
          )
)

RETURN 

if(  ActualCumAdj =  0, BLANK(),  ActualCumAdj)

also, the reason of the error is that you missed one ")".

You missed to close the calculate code before putting =0.

You can easily trace it if you will organise your formula with correct spaces and br

View solution in original post

Anonymous
Not applicable

I finally had a chance to try your solution out. It works. Awesome.

View solution in original post

10 REPLIES 10
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

As @AnkitBI said, you could create a measure to replace 0 to blank. Then when you put it to chart, it will just show the values without 0. In addition, you also could type a start value in Y-axis line to implement it.

2.PNG3.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AnkitBI
Solution Sage
Solution Sage

Please try creating a measure like below. This will return blank, if Line Measure has value 0 else value. Then use this measure in Line Chart.

Measure 5 = if(sum('Table (3)'[Column2]) = 0,blank(),sum('Table (3)'[Column2]))

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

It really helped, thank you very much!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
Anonymous
Not applicable

Hi. Thank for your reply, Ankit.

 

I tried to use the IF formula to the existing formula. My attempt says that there is too few arguement for the IF function. My formula is :

 

Actual Cumulative Adj =
if(CALCULATE(
    SUM('Fact Summary'[YTD Actuals]),
    FILTER(
        ALLSELECTED('DimDate'[FIN_YR_MONTH]),
        ISONORAFTER('DimDate'[FIN_YR_MONTH], MAX('DimDate'[FIN_YR_MONTH]), DESC)
    )=0, BLANK(),
CALCULATE(
    SUM('Fact Summary'[YTD Actuals]),
    FILTER(
        ALLSELECTED('DimDate'[FIN_YR_MONTH]),
        ISONORAFTER('DimDate'[FIN_YR_MONTH], MAX('DimDate'[FIN_YR_MONTH]), DESC)
    )
)
))
 
Can you tell what I am doing wrong?
Thanks.

Hi @Anonymous ,

 

Try putting your previous formula in VAR

Actual Cumulative Adj =
VAR  ActualCumAdj =  
   CALCULATE(
       SUM('Fact Summary'[YTD Actuals]),
           FILTER(
               ALLSELECTED('DimDate'[FIN_YR_MONTH]),
               ISONORAFTER('DimDate'[FIN_YR_MONTH],         
                      MAX('DimDate'[FIN_YR_MONTH]),
                      DESC)
          )
)

RETURN 

if(  ActualCumAdj =  0, BLANK(),  ActualCumAdj)

also, the reason of the error is that you missed one ")".

You missed to close the calculate code before putting =0.

You can easily trace it if you will organise your formula with correct spaces and br

Anonymous
Not applicable

Thank you! Your solution works!

Hi @Anonymous ,

It caused by brackets. Try this.

Actual Cumulative Adj =
IF (
    CALCULATE (
        SUM ( 'Fact Summary'[YTD Actuals] ),
        FILTER (
            ALLSELECTED ( 'DimDate'[FIN_YR_MONTH] ),
            ISONORAFTER ( 'DimDate'[FIN_YR_MONTH], MAX ( 'DimDate'[FIN_YR_MONTH] ), DESC )
        )
    ) = 0,
    BLANK (),
    CALCULATE (
        SUM ( 'Fact Summary'[YTD Actuals] ),
        FILTER (
            ALLSELECTED ( 'DimDate'[FIN_YR_MONTH] ),
            ISONORAFTER ( 'DimDate'[FIN_YR_MONTH], MAX ( 'DimDate'[FIN_YR_MONTH] ), DESC )
        )
    )
)

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Excellent! Thanks a lot

Anonymous
Not applicable

I finally had a chance to try your solution out. It works. Awesome.

@Anonymous . Please confirm if your issue is resolved?

 

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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