cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vinothkumar1990
Helper II
Helper II

Display only the specific text and remove duplicate text

Hi,

I have two columns in a dataset called ID and Message. Message contains multiple lines and each line represent a specific message.

My requirement is

1. I want to show the data(line) only that cotains two specific key words i.e. M-3 or Error.

2. Sometime there couls be duplicate line items. In such case i want to show only distinct value

 

Below is a example. Is there anywat to achive this?

 

Examples:

vinothkumar1990_0-1681314214273.png

 

 

IDMessageExpected Message
1M-1: Message1.
M-2: Message2.
M-3: Error. Message3.
M-3: Error. Message3.
2M-3: Error. Message3.M-3: Error. Message3.
3M-1: Message1.
M-2: Message2.
M-3: Message3.
M-4: Message4.
M-3: Message3.
4M-1: Message1.
M-2: Message2.
M-4: Error.
M-4: Error.
4M-4: Error.
M-4: Error.
M-4: Error.

Thanks in advance!

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @vinothkumar1990 ,

 

Please try to apply the measure to the visual level's filter:

Flag = IF(OR(CONTAINSSTRING(SELECTEDVALUE('Table'[Message]),"M-3"),CONTAINSSTRING(SELECTEDVALUE('Table'[Message]),"Error")),1,0)

vjianbolimsft_0-1681451807735.png

Final output:

vjianbolimsft_1-1681451820772.png

Best Regards,

Jianbo Li

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

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @vinothkumar1990 ,

 

Please try to apply the measure to the visual level's filter:

Flag = IF(OR(CONTAINSSTRING(SELECTEDVALUE('Table'[Message]),"M-3"),CONTAINSSTRING(SELECTEDVALUE('Table'[Message]),"Error")),1,0)

vjianbolimsft_0-1681451807735.png

Final output:

vjianbolimsft_1-1681451820772.png

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors