Forum Discussion

SYM1986's avatar
SYM1986
Helper I
5 years ago
Solved

how to keep two formats in one column.

KPI Value Turnover rate 3% NC rate 1% Transportation cost 1.73 operation cost 2.2   Hi all, I have a report to finish with using power bi, the data source is silimarl ...
  • v-cazheng-msft's avatar
    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.