Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Sorting data using another field

Have created a concatenate field using Project Name and Date Logged fields e.g. Desktop Refresh (01/07/2021), etc. and am displaying it in a Stacked bar chart. I want to order it using the Date Logged field.

Have gone into the Data view and tired to sort it using the above field however I get:

 

We can't sort the Concatenate1" column by "DateLogged". There can't be more than one value in the "DateLogged" for the same value in "Concatenate1". Please choose a different column for sorting the data in "Date Logged"

  • selimovd's avatar
    selimovd
    5 years ago

    Hey Anonymous ,

     

    yes, as the error says: There can't be more than one value in the "DateLogged" for the same value in "Concatenate1".

     

    Fix that and it will work.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • Anonymous's avatar
    Anonymous
    5 years ago

    Found the issue and have now resolved it. Thanks for your help on this.

5 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Anonymous ,

     

    when you use a sort by column each sort by field has to be unique for each value.

    For example when you would sort month name by month number, how should Power BI sort if there is a row that says January is month number 1 and another row says January is month number 3.

     

    So you have to make sure the sort by column always returns the same value, for example for January it must return always 1. Check that in your data model and it should work.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks selimovd for the response.

       

      Understand (I think) what you've said but I am trying to sort [Project Name]-[(Date Logged)] with the [Date Logged] field. *- Checked the Data model and the format for this is dd/mm/yyyyy so I can't see how that could ever return a different answer. There may be occassions where 2 different projects get logged on the same day. Is that where the problem is?

      • selimovd's avatar
        selimovd
        Most Valuable Professional

        Hey Anonymous ,

         

        yes, as the error says: There can't be more than one value in the "DateLogged" for the same value in "Concatenate1".

         

        Fix that and it will work.

         

        If you need any help please let me know.
        If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
         
        Best regards
        Denis