Forum Discussion
Add column by specific text by dates
- 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. - Anonymous1 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.
Add a New Column Based on Specific Text in "Work notes":
Action Taken by =
IF(
CONTAINSSTRING([Work notes], "took"),
"ECC took care",
IF(
CONTAINSSTRING([Work notes], "escalated"),
"Taken care by CX",
BLANK()
)
To sort the data by the dates mentioned in the "Work notes" column, you need to extract the date from the text and then sort the data based on this extracted date.
You can create a new column to extract the date from the "Work notes" column using DAX. Assuming the date format in the "Work notes" is consistent, you can use the following DAX formula:
Extracted Date =
DATE(
MID([Work notes], 1, 4),
MID([Work notes], 6, 2),
MID([Work notes], 9, 2)
)
After creating the "Extracted Date" column, you can sort your data by this column.
To handle duplicate entries, you can use Power BI's data transformation capabilities in Power Query Editor. You can group by the "Incident Start" or any other relevant column and then sort within each group by the "Extracted Date".
Go to Power Query Editor.
Select the column you want to group by (e.g., "Incident Start").
Use the "Group By" feature to group the data.
Within each group, sort the data by the "Extracted Date" column.