Forum Discussion

Tripb44's avatar
Tripb44
Helper II
4 years ago
Solved

Average Totaling incorrectly

My total of a measure is not totalling correctly.  Circled below is the issue, if I export this table, the total of that column is around $12,000,000.  Any advice to modify the measure dax to reflect the correct total is much appreciated.  Thanks.


 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Tripb44 ,

    Your wrong average in total should be caused by "SUMX(VALUES(...),_avginvoice)" in false part in IF function. This code won't return correct result if you use it in same code. I suggest you to create a new measure based on [Average Invoice p2]. You can let [Average Invoice p2] return "_avginvoice" directly.

    New code.

    NewMeasure = SUMX(VALUES('Cycletime_Invoice_Date(2)'[InvoiceNum]),[Average Invoice p2] )

    Then add this new measure into your table visual, it will return correct result.

     

    Best Regards,
    Rico Zhou

     

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

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Tripb44 ,

    Your wrong average in total should be caused by "SUMX(VALUES(...),_avginvoice)" in false part in IF function. This code won't return correct result if you use it in same code. I suggest you to create a new measure based on [Average Invoice p2]. You can let [Average Invoice p2] return "_avginvoice" directly.

    New code.

    NewMeasure = SUMX(VALUES('Cycletime_Invoice_Date(2)'[InvoiceNum]),[Average Invoice p2] )

    Then add this new measure into your table visual, it will return correct result.

     

    Best Regards,
    Rico Zhou

     

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