Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Incorrect Total in Table

Hi guys, 

 

I have exactly the same problem shown in the example below.

 

The TOTAL is not adding up the 'duplicate' values in the table (In the example: 3+3+5+5+2 = 18). The TOTAL is only considering the values of the data source (In the example: 3+5+2). 

 

How can I resolve this?

 

  • Anonymous , make sure you are using sales person from table1 and then check

     

    else try this measure

    sumx(summarize(Table1,Table1[Date], Table1[Sales Person], "_1", sum(Table2[Amount]])),[_1])

4 Replies

  • Anonymous , make sure you are using sales person from table1 and then check

     

    else try this measure

    sumx(summarize(Table1,Table1[Date], Table1[Sales Person], "_1", sum(Table2[Amount]])),[_1])

  • Hi, Anonymous 

    Please correct me if I wrongly understood your question.

    In my opinion, the first table is a Fact Table, and the second table is a Dim-Table. And those have *-1 relationship.

    And the amount is inside the Dim-Table.

    In this way, the amount is only duplicated because of the fact table's structure. So, the number is correctly shown.

    If this has to be fixed, then try to write a measure like below.

     

    Please also check the sample pbix file's link down below.

     

    measures = SUMX('Table', RELATED(Table2[Amount]))
     
     
     

    Hi, My name is Jihwan Kim.

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

    • Jihwan_Kim's avatar
      Jihwan_Kim
      Super User

      Hi, Anonymous 

      I do not know what is the logic how to calculate those, but I just tried to simply multiply two values.

      Please check the measures down below. If the logic is incorrect, then you can simply change the multiplier to your correct logic.

       

      HS AS Total =
      SUMX (
      RELTMS,
      RELTMS[Hours]
      * LOOKUPVALUE (
      Actuals__022021[HS A/S],
      Actuals__022021[%Chave_RELPRJ], RELTMS[%Chave_RELPRJ]
      )
      )
       
      Sizing Total =
      SUMX (
      RELTMS,
      RELTMS[Hours]
      * LOOKUPVALUE (
      Actuals__022021[SIZING],
      Actuals__022021[%Chave_RELPRJ], RELTMS[%Chave_RELPRJ]
      )
      )
       

      Hi, My name is Jihwan Kim.

      If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.