Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Niiru1
Helper V
Helper V

Format STRING text for colour and italics

Is there a way for format colour and font in the same measure?

 

1. Search for specific text in STRING  e.g. "Table 3." in "Table 3. This table represents all of my sample data. Data source Datamart"

 

2. Search for specific text in STRING  e.g. "Data source Datamart" in "Table 3. This table represents all of my sample data. Data source Datamart" and FORMAT it to make it Italic

 

E.g. Measure

Title Table 3. =
VAR _Text = "Table 3. This table represents all of my sample data. Data source Datamart"
RETURN
SWITCH(TRUE(),VALUE(_Text) = "*Table 3.*","#094")
3 REPLIES 3
Fowmy
Super User
Super User

@Niiru1 

Your question is not clear enough for me. If you need to check if certain text exists in a given text then try like:

E.g. MeasureTitle Table 3. = 
VAR _Text = "Table 3. This table represents all of my sample data. Data source Datamart"
RETURN
SWITCH(
    TRUE(),
    CONTAINSSTRING(_Text,"Table 3."),"Found", 
    "#094"
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

This works for returning found but is there a way to return the full _Text string with just "Table 3" colour changed?

 

Something like:

SWITCH(
TRUE(),
CONTAINSSTRING(_Text,"Table 1"),_Text,"094")

Hey @Niiru1 ,

 

it's currently not possible to add color or other formatting options to a partial string.

You can create an idea here: Ideas (powerbi.com)

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.