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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
naveenpadala
Regular Visitor

Concatenating decimal value column with '%' when a string column contains '%' in it.

naveenpadala_0-1698297581422.pngdata view

naveenpadala_1-1698297904111.pngvisual view

 

Above is the table i have. Amount column is storing values as decimals which includes percentage values also (see SubCategory column). but i want to show '%' symbol beside the percentage value in Amount column wherever the SubCategory column value contains '%' in it. Its a Matrix visual.


 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @naveenpadala 
if I understood you correctly you can surround your measure with "If"
Like : 

formated_% = if(CONTAINSSTRING(SELECTEDVALUE('Table'[category]),"%"),FORMAT([your measure_],"0.0%"),FORMAT([your measure_],"0"))
Ritaf1983_1-1698301879570.png

 


Pbix attached

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

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hi @naveenpadala 
Please update the formula to :

formated_%2 = if(CONTAINSSTRING(SELECTEDVALUE('data'[SubCategory]),"%"),FORMAT(SUM([Sum of Amount]),"0.00")&"%",FORMAT(sum(data[Sum of Amount]),"0.00"))
Ritaf1983_0-1698337132135.png

The updated PBIX attached 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

9 REPLIES 9
Ritaf1983
Super User
Super User

Hi @naveenpadala 
if I understood you correctly you can surround your measure with "If"
Like : 

formated_% = if(CONTAINSSTRING(SELECTEDVALUE('Table'[category]),"%"),FORMAT([your measure_],"0.0%"),FORMAT([your measure_],"0"))
Ritaf1983_1-1698301879570.png

 


Pbix attached

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

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @naveenpadala 

I attached a pbix to the first response, you can download it and check my steps to compare with yours .
Also you you can attach some sample data / link to dummy pbix and i will look at why it didn't work.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

hi @Ritaf1983 ,

please find the dataset in Visits.pbix file in the below link.

Visits.pbix

Hi @naveenpadala 
Please update the formula to :

formated_%2 = if(CONTAINSSTRING(SELECTEDVALUE('data'[SubCategory]),"%"),FORMAT(SUM([Sum of Amount]),"0.00")&"%",FORMAT(sum(data[Sum of Amount]),"0.00"))
Ritaf1983_0-1698337132135.png

The updated PBIX attached 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you @Ritaf1983, it worked this time.

Glad to help ☺️

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

hi,

naveenpadala_1-1698305724226.png

This method did not work. '%' is not concatenated to the 'Amount' values.

123abc
Community Champion
Community Champion

To display the '%' symbol beside the percentage value in the "Amount" column whenever the "SubCategory" column contains '%' in it in a Matrix visual, you can use the Power BI DAX (Data Analysis Expressions) language to create a calculated column or measure. Here's a step-by-step guide to achieving this:

  1. Open your Power BI file and go to the "Data" view.

  2. Create a new calculated column in your data model. To do this, select the "Model" view, find your table, and then right-click on the table. Choose "New Column."

  3. Use a DAX formula to create the calculated column. You can use the following formula:

Amount with Percentage = IF(ISNUMBER(SEARCH("%", YourTable[SubCategory])), YourTable[Amount] & "%", YourTable[Amount])

 

Replace "YourTable" with the name of your table, and "SubCategory" and "Amount" with the actual column names in your table.

The formula checks if the "SubCategory" column contains the '%' symbol. If it does, it appends '%' to the "Amount" value; otherwise, it leaves the "Amount" as it is.

  1. Once you've created the calculated column, save your changes and return to the "Visual" view.

  2. In the Matrix visual, use the new "Amount with Percentage" column in place of the original "Amount" column. You can drag and drop it into the Values section of the Matrix visual.

Now, your Matrix visual should display the '%' symbol beside the percentage value in the "Amount" column wherever the "SubCategory" column contains '%' in it.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

hi,

naveenpadala_0-1698305554836.png

This is the error i face when i try your method.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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