Forum Discussion

dicarva's avatar
dicarva
Frequent Visitor
1 year ago

Problem with Reference Line when trying to update filters

Hi there,

I'm new to BI, and I would like to know, if there is a way to correct the problem with two references lines in graphic bars.
I have two lines and when I click on the date to filter, in a year that doesn't have any values, one reference disappears (which is okay) and the other one goes to the bottom, and this one should also disappear. For each line I have measures.
Is this a BI problem or am I so dumb?

Thank you! 🙂

6 Replies

  • Hi dicarva 
    Do you mind sharing your measures used? Typically if you select a date or a period and there are no values, the reference line should automatically go away. Perhaps you could add an additional criteria on top to force it to disappear.

    • dicarva's avatar
      dicarva
      Frequent Visitor

      Thank you for answer.
      I will share the graph and the measures for a better understand.
      This is the correct graphc aspect:

       Then when I clicked in the filter this happens:

       
      The first measure: 

      MedidaByPass = CALCULATE(
              AVERAGEX(
                  FILTER(
                      CenariosIDE,
                      CenariosIDE[Estado] = TRUE &&
                      CenariosIDE[Descricao] = "CER Bypass"
                  ),
                  CenariosIDE[Valor]
              ),
              USERELATIONSHIP(CenariosIDE[Ano], Calendar[Ano])
          )

      Another measure: 
      MedidaMeta =
          CALCULATE(
              AVERAGEX(
                  FILTER(
                      CenariosIDE,
                      CenariosIDE[Estado] = TRUE &&
                      CenariosIDE[Descricao] = "Meta"
                  ),
                  CenariosIDE[Valor]
              ),
              USERELATIONSHIP(CenariosIDE[Ano], Calendar[Ano])
          )



      I'm sorry because my Bi is in Portuguese.

      I hope this can help you to understand.

      • hnguy71's avatar
        hnguy71
        Super User

        Hi dicarva 

        Can you try this?

        MedidaMeta =
        
        VAR _Result = 
            CALCULATE(
                AVERAGEX(
                    FILTER(
                        CenariosIDE,
                        CenariosIDE[Estado] = TRUE &&
                        CenariosIDE[Descricao] = "Meta"
                    ),
                    CenariosIDE[Valor]
                ),
                USERELATIONSHIP(CenariosIDE[Ano], Calendar[Ano])
            )
        
        RETURN
        
        If( _Result > 0, _Result, Blank() )