Forum Discussion

floralau's avatar
floralau
New Member
4 years ago
Solved

Top N error: The expression refers to multiple columns.

Hi all,   I am new to power bi and faced some difficulties. What's wrong with my following code?   measure = TOPN( 3, 'Succesful Rate', 'Succesful Rate'[Channel],0 )   The error messa...
  • PhilipTreacy's avatar
    4 years ago

    Hi floralau 

     

    Download example PBIX file with the following code

     

    TOPN returns a table which is why you are getting the error about 'multiple columns'.  I guess you are trying to create a measure, but a measure must be a single value, it can't hold a table.

     

    To count the number of different strings use this measure

     

    Number of Diff Strings = DISTINCTCOUNT('Successful Rate'[Channel])

     

     

    Regards

     

    Phil