Forum Discussion

afaherty's avatar
afaherty
Icon for Helper V rankHelper V
4 years ago
Solved

PowerBI is counting the same value as 2 different values

Hello,

This is a very complicated question, therefore I am trying to simplify it and I hope I don't confuse anyone further.

I have a database of student evaluations.  Their professor has rated them on different items (i.e., rated them as being "proficient" or "developing" on different aspects).

Does anyone know why on earth is PowerBI counting the same rating ("Proficient") as two different values?

 

Basically, there should be only 1 row for Proficient and it should equal 35.  I have been sitting here for hours trying to figure this out.  I see no reason for this.  I just thought I'd ask if anyone has seen this before.  The DAX for the value field in the matrix is just  a DISTINCTCOUNT of student ID.

 

In Data view, there does not seem to be an obvious reason for this (i.e., extraneous spaces, etc):

 

 

Thanks!

  • I found another post from someone who had the same problem a few years ago.  When they re-did the dashboard from scratch, the problem went away.  I just tried the same thing, and my problem has resolved as well.  

6 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi afaherty 

    try replace the value in power query. Like:

    each [column], each "Proficient"

  • daXtreme's avatar
    daXtreme
    Icon for Solution Sage rankSolution Sage

    The fact that 2 strings look the same to your eyes does not mean they are the same. There might be some non-printable characters embedded in either of them. You should cleanse your data well in Power Query (or in the source). For instance, there are spaces that are zero-length...

    • afaherty's avatar
      afaherty
      Icon for Helper V rankHelper V

      I found another post from someone who had the same problem a few years ago.  When they re-did the dashboard from scratch, the problem went away.  I just tried the same thing, and my problem has resolved as well.  

      • Anonymous's avatar
        Anonymous
        Not applicable

        Is this the only way? I have many visuals already on the page and are quiet fidely. How better could I do this ?

  • Hi:

    To follow a few replies here. To see if DAX has gone wild, you can go to TRANSFORM Data and highlight your column and first select clean and after repeat with "trim". Both options are under the TRANSFORM Tab. Choose FORMAT and the there is a drop down. These two functions(Clean & trim) take away spacing issues and also take away any non printable characters. I've rad it's best practice to do this before loading data.

     

    If you do this and you still have an issue, then maybe DAX has an issue? I hope this helps!

     

     

  • Aivars's avatar
    Aivars
    Frequent Visitor

    I had the same issue. Trim, Clean and Capitalize Each Word was no help. Solution was to simply make a copy of the column and delete the original one. No more "duplicate" values after that.