Forum Discussion

AbhinavJoshi's avatar
AbhinavJoshi
Responsive Resident
3 years ago

Wrong Total in Table

Hello All, 

 

I recently changed by data soource from Excel to SQL Datbase. I have both the table visuallization, and thier data is same. However, my total at the end of table comes to be wrong. Any ideas why this could be happening. 

 

Thanks

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AbhinavJoshi 

    You can try to use sumx() function.

    e.g SUMX(Values(Table[id]),[Measure])

     

    Best Regards!

    Yolo Zhu

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

  • Hi AbhinavJoshi ,

     

    Did you use DISTINCTCOUNT or a similar function or reference a measure that uses this function? If so, that behaviour is expected. To illustrate, the unique count of  [Item] per [Category] is 1 for each but in total there are only two unique items which are 0001 and 0002

    Category Item
    A 0001
    B 0001
    C 0001
    D 0002
  • AbhinavJoshi's avatar
    AbhinavJoshi
    Responsive Resident

    Thank you all for answering, I found out the error was due to in-appropriate relationships. When I was connected using Excel Workbook I had Custom Reltaionships but when I get the data from SQL Database, it auto created the relationships because I checked the include relationships checkbox. 

     

    Thank you all for support!