Forum Discussion

lorenz0210's avatar
lorenz0210
Helper I
2 years ago
Solved

How to count column

Hi everyone,

I am working counting activities per company and their opportunities. I created a table to show theh data. However, it seems the calculation is wrong. 

 

Here is the category and I count manually: 

Grand Total23

Call4
Emails10
Meeting9

 

 

Here is the screenschot: 

 

But the total shows 54 which incorrect. Hope anyone can help. 

Thank you. 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  lorenz0210 ,

    I created some data:

     

    Here are the steps you can follow:

    If you have duplicates in your data that could cause this counting error situation, you might consider creating a measure:

    Measure =
    var _table=
    DISTINCT('Table')
    return
    COUNTX(
        _table,[id])

     

    If it doesn't meet your desired outcome, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

     

    Best Regards,

    Liu Yang

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

4 Replies

  • Hey lorenz0210 

     

    It's a common issue.

    It depends on your model, calculation and visual setting.

    BTW, check this blog, might be helpful:
    https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total

     

     

    or share sample of your data in text format or add more details to be able to test that 🙂


     

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

    Appreciate your Kudos!! 

    LinkedIn | Twitter | Blog | YouTube 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  lorenz0210 ,

    I created some data:

     

    Here are the steps you can follow:

    If you have duplicates in your data that could cause this counting error situation, you might consider creating a measure:

    Measure =
    var _table=
    DISTINCT('Table')
    return
    COUNTX(
        _table,[id])

     

    If it doesn't meet your desired outcome, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

     

    Best Regards,

    Liu Yang

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