Forum Discussion

PranavKhedkar's avatar
PranavKhedkar
New Member
2 years ago
Solved

Duplicate values are causing summation

I have a table which contains the columns: id, Title and Rating. 'id' has unique values, 'Title' has names of movies and TV shows and 'Rating' has their IMDB score(out of 10). I want to create a clus...
  • barritown's avatar
    2 years ago

    Hi PranavKhedkar,

    Should I approach such a problem, I'd create an additional column with an alternative name and use it for my bar chart. 

    Like that, for example:

    DAX code in plain text:

    Alt Title = 
    VAR CurrentTitle = [Title]
    VAR MoviesWithThisName = COUNTROWS ( FILTER ( Movies, [Title] = CurrentTitle ) )
    RETURN IF ( MoviesWithThisName > 1, [Title] & " (ID " & [ID] & ")", [Title] )

    Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian