Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Power BI

Measure 19 = IF(COUNTROWS(VALUES('AIPL 2(Line Scan)'[MN])) = 1, SUM('AIPL 2(Line Scan)'[MN]),SUMX(VALUES('AIPL 2(Line Scan)'[MN]), 'AIPL 2(Line Scan)'[MN])) The above formula does not work when the values are not unique

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    Please help me to tackle the problem
  • Anonymous's avatar
    Anonymous
    Not applicable

    TRY = SUMX(VALUES('AIPL 2(Line Scan)'[MN]),CALCULATE(AVERAGE('AIPL 2(Line Scan)'[MN])))

    I used this formula as well but this again shows average instead of showing sum total at bottom. i have attached a screenshot.

    Please check for B3 line. the total should be 69+69=138 but it shows 69 only

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Attaching here the Screenshot fyr.

      Here if you see for B3 line, since the values are same for B3A & B3B line i.e 69, total is coming 69 only, ideally its should be 69+69=138.

      Please help.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi , I have been prohibited to share anything.

      For your understanding, i am explaining the scenario here.

      I have two tables Production & Target. In production table i have columns namely date, order number, hour1 production, line, section . In target entry table we have column namely,date order number. line, section and target. so now i have connected both the tables on the basis of date. 

      Now the problem here is sometime they have same target entry in the target table so instead of giving total it shows average as you can see. for that i have used the measure which has the formula TRY = SUMX(VALUES('AIPL 2(Line Scan)'[MN]),CALCULATE(AVERAGE('AIPL 2(Line Scan)'[MN])))