Extract issue comments

 

  1. Open Power BI Desktop.

  2. Go to the Modeling tab.

  3. Click on New Column.

  4. Enter the following DAX formula:

dax
ExtractedIssue = 
VAR StartPos = SEARCH("Issue", 'YourTableName'[Issue Comments], 1, LEN('YourTableName'[Issue Comments]))
VAR ExtractedText = MID('YourTableName'[Issue Comments], StartPos, LEN('YourTableName'[Issue Comments]) - StartPos + 1)
RETURN
    IF(StartPos > 0, ExtractedText, BLANK())

Explanation:

  • SEARCH("Issue", 'YourTableName'[Issue Comments], 1, LEN('YourTableName'[Issue Comments])): Finds the starting position of the string "Issue" in the Issue Comments column. If "Issue" is not found, it returns the length of the string, ensuring that the MID function doesn't fail.

  • MID('YourTableName'[Issue Comments], StartPos, LEN('YourTableName'[Issue Comments]) - StartPos + 1): Extracts the substring starting from the position where "Issue" is found to the end of the string.

  • IF(StartPos > 0, ExtractedText, BLANK()): Checks if "Issue" was found in the string. If not, it returns a blank.

No comments

Theme images by tjasam. Powered by Blogger.