Forum Discussion

Deelip's avatar
Deelip
Icon for Resolver I rankResolver I
2 years ago
Solved

Card total/table total doesn't match with the data

Hi all,   I have seen this type of question on the forums. I tried to implement as per the forums but none of them got me to the solution. I am lost on this problem. The sum of total cost is not m...
  • Ashish_Mathur's avatar
    2 years ago

    Hi,

    You will have to use the SUMX() function as a measure.

    Total = sum(Data[Revenue])

    Measure = SUMX(VALUES(Data[Product]),[Total])

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hello,Ritaf1983  and Ashish_Mathur ,thanks for your concern about this issue.

    Your answers are excellent!
    And I would like to share some additional solutions below.

    Hi,Deelip .I am glad to help you.

    I think you can try Ashish_Mathur's suggestion.
    Total columns ending up with incorrect calculations is a common problem in Power BI.
    The possible reasons are as follows:
    The column/row total has no context due to the lack of context, plus the calculation logic in the dax code itself is not simply a direct use of a single aggregation function, e.g.

    column_test =SUM('Table'[column]);
    measure_test=MAX('Table'[column]);


    In general, this directly use a power BI aggregation function, Total column display data will also be directly using the calculation logic are data for aggregation operations.
    If you use the summarize function and redefine a series of calculation environments in it, then the Total column in visual may not return the correct value.

    You can try to create some calculation logic simple measure to replace the original error data.
    For example, using the SUMX function

    If you can share the pbix file which does not contain sensitive data and the corresponding code, then this will help you to solve your problem.

    If you are unable to share your data file, hopefully the following articles will help.
    URL:

    Why Power BI totals might seem inaccurate - SQLBI
    How to Fix Incorrect Totals in Power BI Tables (databear.com)
    Solved: Help with incorrect totals in table and card visua... - Microsoft Fabric Community

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.