Forum Discussion

smatesic's avatar
smatesic
Helper I
9 years ago
Solved

Total/sum working incorrectly

Does anyone knows what's going on here and how to deal with it? 

 

 

Table on the right has data from only one table and everything looks good. Table on the left side has data from two tables and total valus don't add up correctly. PowerBI is summing only by value of Tarifa, and the fact there are, for example, two Interent packages is not taken into the equation. 

 

Here is my model

 

 

Two tables that I'm taking data from - Packages(Paketi) and Clients(Klijenti) - are directly connected with 2way relationship direction. Column Price is original column - no Dax or any other function applying there, and Price per month is calculated column: 

PricePerMonth = Paketi[Price] / Paketi[DurationMonths]

 

I tried with various calculated columns and measures. I searched PBI forum, there were lot's of simmilar issues but not quite like this one

 

  • smatesic

     

    I’ve tried it again and it worked in my side. I’ve uploaded my .pibix file here. Could you please take a look at it to see if there is any difference?

     

    Best Regards,

    Herbert

6 Replies

  • v-haibl-msft's avatar
    v-haibl-msft
    Microsoft Employee

    smatesic

     

    Please try with following measure formula.

    Measure = 
    SUMX ( Forcasting, CALCULATE ( SUM ( Paketi[Price] ) ) )

     

    Best Regards,

    Herbert

     

     

    • smatesic's avatar
      smatesic
      Helper I

      It doesn't work. Total Price should be $2000 and with this measure I got millions

       

      Also, Anita has 3 Internet packages and in PBI only one is shown. 

       

       

      These are my source tables, everything is visible there:

      Clients table (Client/Tarifa/DueDate):

       

      Mike

      Internet1.10.2016
      JoseStorage1.9.2016
      AnitaIT solutions1.11.2016
      DavidCloud services1.2.2017
      MikeInternet1.12.2016
      MikeInternet1.2.2017
      PaulinaBI analytics1.11.2016
      AnitaInternet1.1.2017
      AnitaInternet2.2.2017
      AnitaInternet2.4.2018
      AnitaBI analytics1.6.2017

       

      Packages table (Tarifa/Price/DurationMonths):

      Storage $              50,006
      Internet $            100,002
      IT solutions $            150,001
      Cloud services $            200,003
      BI analytics $            500,003

       

       

       

  • v-haibl-msft's avatar
    v-haibl-msft
    Microsoft Employee

    smatesic

     

    I’ve tried it again and it worked in my side. I’ve uploaded my .pibix file here. Could you please take a look at it to see if there is any difference?

     

    Best Regards,

    Herbert

    • smatesic's avatar
      smatesic
      Helper I

      This works now. I used columns from Client and Packages tables, from forcast table which is Crossjoined table I only used date column and I got correct totals. I tried using values from forcast, and totals were wrong again... Nevermind, it works and this issue is solved. Thank you for your help

    • rezaieehsan's avatar
      rezaieehsan
      Frequent Visitor

      hi i have somehow same problems to get currtect column summurization or rowwise sumurization,

      please could u quide me how can i get sum in visual level number from each months.

      please check the picture attached