Forum Discussion

o59393's avatar
o59393
Post Prodigy
3 years ago

Sumx not returning expected total

Hi all

 

I created a measure that is supposed to return the total, in place it's returning the sum of all the table.

 

The expected result should be the sum of 65922+24951+1397516 = 1,488,389. How ever it return the total production of the table 67,166,145:

 

 

The measure I created is: 

 

Measure = 
SUMX(
SUMMARIZE(
'Produccion',
'Produccion'[Producción ],
Produccion[Fecha],
Produccion[Código AX]
),
'Produccion'[Producción ]
)

 

Where fecha means date,

Codigo AX, is the code of the product 

and produccion means production

 

Thanks.

 

3 Replies

  • o59393 , it will sum the distinct values across 'Produccion'[Producción ], Produccion[Fecha], Produccion[Código AX], in case values are repeated it will not consider in GT

     

    Try like

    Measure =
    SUMX(
    SUMMARIZE(
    'Produccion',
    'Produccion'[Producción ],
    Produccion[Fecha],
    Produccion[Código AX],
    "_Sum", max(Produccion[Código AX])
    ),
    [_Sum]
    )

     

     

  • Hi o59393 ,

     

    What does your raw data look like?

    Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

    Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

     

    Refer to:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.