Forum Discussion

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    chotu27,

    As mentioned by the above error message, when you have multiple rows which contain same values for status column(e.g, row1:Active, row2:Active, row3:Active), you should have same sort number(e.g, row1:1,row2:1,row3:1) in Custom Status column.

    Regards,
    Lydia

    • chotu27's avatar
      chotu27
      Post Patron

      Anonymous Yes exactly but i am sorting the table which other column is there any chnace of getting this done.

      • Anonymous's avatar
        Anonymous
        Not applicable

         We added "sort by" columns to our SQL date/time table - so we can sort the months properly.

         

        Here is the magic SQL we found that sets the "sort by" up correctly for Power BI.

         

        --Month
        UPDATE dbo.Time SET Month_Period_Of_Time = RowNumber
        FROM dbo.Time TM, (SELECT [Month], ROW_NUMBER() OVER (ORDER BY  [Month]) AS RowNumber FROM dbo.Time) AS TMR
        WHERE TM.[Month] = TMR.[Month]

        UPDATE dbo.Time SET Month_Period_Of_Time_Reverse = RowNumber
        FROM dbo.Time TM, (SELECT [Month], ROW_NUMBER() OVER (ORDER BY  [Month] DESC) AS RowNumber FROM dbo.Time) AS TMR
        WHERE TM.[Month] = TMR.[Month]

         

        Each month ends up with the same sort number.