Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Power Bi Visual Help

I have created a visual on power bi and the results equal 100%- which is expected. However, once I add my filter (that is a measure), and apply this filter, i am getting results that equal up to 150%. Does anyone know why this may be?

7 Replies

  • Arul's avatar
    Arul
    Icon for Super User rankSuper User

    Anonymous ,

    I think there is something wrong with your measure. Can you share the formula and the expected output?

  • Anonymous's avatar
    Anonymous
    Not applicable

    This is the measure I am using:

     

    %ofGrade1&2 Test =
     

    VAR Sumof12 =
    CALCULATE(
        [Total Weight Produced],
        'PRODUCTION- Results'[Grade Type] = "1" ||
        'PRODUCTION- Results'[Grade Type] = "2")

    VAR TotalLbs=
    CALCULATE(
        SUM('PRODUCTION- Results'[Total Weight]),
        ALL('PRODUCTION- Results'[Grade Type])
    )

    RETURN
    CALCULATE(
    DIVIDE(
    Sumof12,
    TotalLbs
    )
    )
     
    I am hoping for it to evaluate Grade 1 and 2 combined, and only populated results where Grade1+Grade2=less than 50%
    • Arul's avatar
      Arul
      Icon for Super User rankSuper User

      Anonymous ,

      What is the slicer column?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Sorry i am fairly new to DAX and power bi. What do you mean by slicer column?

     

    • Arul's avatar
      Arul
      Icon for Super User rankSuper User

      Anonymous ,

      Which filter do you apply?

  • Anonymous's avatar
    Anonymous
    Not applicable

    that is the filter i am trying to apply. It is a measure

     

    This is the formula for the entire table:

    Grade % =
    VAR TotalWeight =
    CALCULATE(
        SUMX(
            'PRODUCTION- Results','PRODUCTION- Results'[Total Weight])
    )

    VAR GradeTypeTotalWeight =
    CALCULATE(
        SUMX(
            'PRODUCTION- Results','PRODUCTION- Results'[Total Weight]),
            REMOVEFILTERS('PRODUCTION- Results'[Grade Type])
           
    )


    RETURN
    DIVIDE(
        TotalWeight,
        GradeTypeTotalWeight
    )