Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How to avoid double counting for Sums?

My data is like this in the underlying table:    My visual is like this:      When I show the total of Trx amount in a card for the visual, it shows 350 instead of 175. Because the u...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Thank Ahmedx  for his prompt reply.

    Hi Anonymous  ,

    Depending on the information you have provided, I created a sample data to help you solve your problem. You can follow these steps below.
    Sample data:

    1.Add new measure.

    Sum of Trx = 
    VAR _PersonID =
        SELECTEDVALUE ( 'Table'[Person_ID] )
    VAR _CountProj =
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[Proj_ID] ),
            FILTER ( 'Table', 'Table'[Person_ID] = _PersonID )
        )
    RETURN
        DIVIDE ( SUM ( 'Table'[Trx] ), _CountProj )
    

     Final output:

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Ada Wang

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