Forum Discussion
how to keep two formats in one column.
- 5 years ago
Hi, SYM1986
You can create a Measure with CONTAINSSTRING and FORMAT function. However, the data type of values in this Measure is Text. As CNENFRNL said, there is only one data type for one column.
TwoFormatsValue = IF(CONTAINSSTRING(SELECTEDVALUE('Table'[KPI]),"rate"),FORMAT(SELECTEDVALUE('Table'[Value]),"#%"),SELECTEDVALUE('Table'[Value]))
The result looks like this:
Best Regards,
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am afraid it is not possible to do in Power BI(Pivot & Query). One column should only have one type. In case we have different data types like numbers and text, it is recommended that we set column type as Text
However, I was able to find a workaround for this here.
See if it works for you.
Please provide a Kudos to this answer if you found it interesting.
If this post helps, then please consider accepting it as the solution to help the other members find it more quickly