Forum Discussion
Concatenating decimal value column with '%' when a string column contains '%' in it.
- 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.
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.
- Ritaf19832 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.
- naveenpadala2 years agoRegular Visitor
Thank you Ritaf1983, it worked this time.
- Ritaf19832 years agoSuper User
Glad to help ☺️