Forum Discussion
naveenpadala
2 years agoRegular Visitor
Concatenating decimal value column with '%' when a string column contains '%' in it.
data view visual 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...
- 2 years ago
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"))
Pbix attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- 2 years ago
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"))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.
Ritaf1983
2 years agoSuper User
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"))
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.
naveenpadala
2 years agoRegular Visitor
Thank you Ritaf1983, it worked this time.
- Ritaf19832 years agoSuper User
Glad to help ☺️