Forum Discussion

Elglouton2's avatar
Elglouton2
New Member
1 year ago

Waterfall - different breackdowns by category

Hello,
I have created a waterfall to visualize my production times.
I would like to know if it is possible to display different breckdowns by category.
for example
for opening time I want to display only AA_Closing time
for the required time I want to display only C_planned time
for the useful time I want to display the rest

 

this means that I don't want to display the values at zero

i can't make this visual do you think it's possible


 

 

4 Replies

  • Hi Elglouton2

     

    You will need to write a measure that conditional filters which breakdown to show based on the current category. Example:

    SWITCH (
        SELECTEDVALUE ( Data[Category] ),
        "AA_Closing time", CALCULATE ( [My Measure], KEEPFILTERS ( Data[Breakdown] = "aa closing time" ) ),
        "Required time", CALCULATE ( [My Measure], KEEPFILTERS ( Data[Breakdown] = "c planned time" ) ),
        "Useful time",
            CALCULATE (
                [My Measure],
                KEEPFILTERS ( NOT Data[Breakdown] IN { "aa closing time", "c planned time" } ) --exclude these two breakdowns
            )
    )
    
    • Elglouton2's avatar
      Elglouton2
      New Member
      Hello,
      I've tried to adapt the measurement to what I use, but without success.
      I'm getting confused about the order in which to make the switches ... I'm going about it all wrong and don't understand everything
      sorry but do you think your solution can be adapted to this measure?
       
      Tps Water Spe_L1 =

      var selectedCategory = SELECTEDVALUE(Category[Category])
      var selectedBreakdown = SELECTEDVALUE(Breakdown[Breakdown])

      return
          SWITCH(selectedCategory,
              "Temps Total",
                  SWITCH(selectedBreakdown,          
                       "AA_Tps Fermeture", 0,
                       "C_Tps Planifié", 0,
                       "E_Cgt Lot", 0,
                       "F_Cgt Conso", 0,
                       "G_Tps Pannes", 0,
                       "H_Tps Orga", 0,
                       "I_Tps Injustifié", 0,
                  SUM(T_BDD_Saisie_Ligne1[Temps total (Jour)])
                  ),

      "Tps Ouverture",
                  SWITCH(selectedBreakdown,
                      "AA_Tps Fermeture", -1*SUM(T_BDD_Saisie_Ligne1[Temps fermeture (Jour)_F]),
                      "C_Tps Planifié", 0,
                      "E_Cgt Lot", 0,
                      "F_Cgt Conso", 0,
                      "G_Tps Pannes", 0,
                      "H_Tps Orga", 0,
                      "I_Tps Injustifié", 0,
                  SUM(T_BDD_Saisie_Ligne1[Temps Ouverture])
                  ),

      "Tps Requis",
                  SWITCH(selectedBreakdown,
                      "AA_Tps Fermeture", -1*SUM(T_BDD_Saisie_Ligne1[Temps fermeture (Jour)_F]),
                      "C_Tps Planifié", -1*SUM(T_BDD_Saisie_Ligne1[Somme_C]),
                      "E_Cgt Lot", 0,
                      "F_Cgt Conso", 0,
                      "G_Tps Pannes", 0,
                      "H_Tps Orga", 0,
                      "I_Tps Injustifié", 0,
                  SUM(T_BDD_Saisie_Ligne1[Temps requis])
                  ),


              "Tps Utile",
                  SWITCH(selectedBreakdown,
                      "A_Tps Total", SUM(T_BDD_Saisie_Ligne1[Temps total (Jour)]),
                      "AA_Tps Fermeture", -1*SUM(T_BDD_Saisie_Ligne1[Temps fermeture (Jour)_F]),
                      "B_Tps Ouverture", SUM(T_BDD_Saisie_Ligne1[Temps Ouverture]),
                      "C_Tps Planifié", -1*SUM(T_BDD_Saisie_Ligne1[Somme_C]),
                      "D_Tps Requis", SUM(T_BDD_Saisie_Ligne1[Temps requis]),
                      "E_Cgt Lot", -1*SUM(T_BDD_Saisie_Ligne1[CG_I]),
                      "F_Cgt Conso", -1*SUM(T_BDD_Saisie_Ligne1[Somme_A]),
                      "G_Tps Pannes", -1*SUM(T_BDD_Saisie_Ligne1[Somme_P]),
                      "H_Tps Orga", -1*SUM(T_BDD_Saisie_Ligne1[Somme_O]),
                      "I_Tps Injustifié", -1*SUM(T_BDD_Saisie_Ligne1[Temps injustifié]),
                      "J_Tps Utile", SUM(T_BDD_Saisie_Ligne1[Temps Utile (TRP)]),
                     
                      SUM(T_BDD_Saisie_Ligne1[Temps utile])
                  )
          )

       

       

      • danextian's avatar
        danextian
        Super User

        You already are using a measure in your waterfall breakdown, aren't you? Why not use that within calculate?

        CALCULATE ( [My Measure], KEEPFILTERS ( Data[Breakdown] = "aa closing time" ) 

         

        or this

        My Measure with OR Conditions =
        CALCULATE (
            [My Measure],
            KEEPFILTERS ( ( Data[Category] = "AA_Closing time"
                && Data[Breakdown] = "aa closing time" )
                || ( Data[Category] = "Required time"
                && Data[Breakdown] = "c planned time" )
                || ( Data[Category] = "Useful time"
                && NOT ( Data[Breakdown]
                IN {
                    "aa closing time",
                    "c planned time"
                } ) ) )
        )