Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to exclude Zero values in Line chart

Dear Team,

 

I want exclude Zero values in Line chart , I have two condition filter tables , if these two table satified then i sum the values .

Here some days may be values zero will come, but i dont want to show if zero value available in both measures.

 

Table 1 :

Measurebydays = DATATABLE("Selection";INTEGER ;{{"1"};{"2"};{"7"};{"15"};{"31"}})

 
Table  2 :
 MeasureBy = DATATABLE("Selection";STRING ;{{"Quantity-EQ"};{"CBM-EQ"}})
 
Last Measure 
 
PLast =
VAR Qone =
IF (
        CONTAINS(MeasureBy; MeasureBy[Selection];"Quantity-EQ") = TRUE ()
     &&
         CONTAINS ( MeasureBydays; MeasureBydays[Selection]; 1 ) = True ();
    CALCULATE(SUM(gpcc_prod_day_analy_rpt_bi[QTY])
         ;FILTER(gpcc_prod_day_analy_rpt_bi
         ;gpcc_prod_day_analy_rpt_bi[Proddt]=TODAY()-1 ));
         0
    )
Return Qone
 
Pervious Measure
 
PPervious =
VAR Qone =
IF (
        CONTAINS(Measureby; Measureby[Selection];"Quantity-EQ") = TRUE ()
     &&
        CONTAINS ( MeasurebyDays; MeasurebyDays[Selection]; 1 ) = True ();
    CALCULATE(SUM(gpcc_prod_day_analy_rpt_bi[QTY])
         ;FILTER(gpcc_prod_day_analy_rpt_bi
         ;gpcc_prod_day_analy_rpt_bi[Proddt]=TODAY()-2));
        0
    )
 
I mapped these two measures in Chart Colume Value , FYI, i tried filter greater than but its not help for my requirement 
 

 
See the chart view, when i choose selection 2 i get below data but i dont want to show Zero values can you please support.
 
  • Anonymous ,

     

    Just add measure below to visual level filter and set Show items when the value is greater than 0.

     

    Measure 3 =
    [Measure] + [Measure 2]
    

     

     

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Can you just add a RETURN like:

     

    IF(__var = 0, BLANK(),__var)

     

    ?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear

       

      Thanks for your respond , but its not worked with my scenario :(

       

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        What if you replace your 0 in your measure with BLANK()?

         

        Going to be difficult to troubleshoot as the things that should normally work don't seem to be, can you share the file?

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    Anonymous ,

     

    Just add measure below to visual level filter and set Show items when the value is greater than 0.

     

    Measure 3 =
    [Measure] + [Measure 2]