Forum Discussion

Manasi25's avatar
Manasi25
Helper II
1 year ago
Solved

Add column by specific text by dates

Hello Team I want to add a new column based on specific text from the existing column by dates. Filtered data should be sorted by the corresponding dates it reported, not by the full Date colum...
  • bhanu_gautam's avatar
    bhanu_gautam
    1 year ago

    First, you need to extract the date part from the "Incident Start" column. You can create a new column in Power BI using DAX to extract the date:

    Incident Date = DATE(YEAR([Incident Start]), MONTH([Incident Start]), DAY([Incident Start]))

     

    After creating the "Incident Date" column, you can sort your data by this column and then by the "Incident Start" time. Here’s how you can do it:

    In the Power Query Editor, select the "Incident Date" column.
    Click on the "Sort Ascending" or "Sort Descending" button to sort the data by the date.
    Next, select the "Incident Start" column.
    Click on the "Sort Ascending" or "Sort Descending" button to sort the data by the time within each day.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Manasi25 ,

    I couldn't agree more with bhanu_gautam, but I have some more personal thoughts.

    Firstly the Data type needs to be changed to Date/time.

    You can sort the Incident Start column in Table view.

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.