Forum Discussion
Power BI table Desktop
I have table in Power BI having two columns. I need want show 0.31 as 31% which is 0.31 multiply by hundred and add % at last for only for values stock tank B2 (EUC) and Stock tank C(Res/ARS) like 31% and 12% remaining all other values does not change. How to do this using Dax in Power BI.
Output:
| Tag_Description | Value |
| Stock tank B2 (Euc) | 31% |
| Stock tank C (Res/ARS) | 12% |
| Stock tank D (Res/ARS) | 0.00 |
| Wickit 1285 (#/ton) | 6.99 |
| CMC Calexis (#/ton) | 2.99 |
- Hi,try this measure:Value Measure For Multiple Data Formats = IF(OR(CONTAINSSTRING(SELECTEDVALUE('TableName'[Tag_Description]),"(Euc)"),CONTAINSSTRING(SELECTEDVALUE('TableName'[Tag_Description]),"(Res/ARS)")),FORMAT(SUM('TableName'[Value])/100,"Percent"),FORMAT(SUM('TableName'[Value]),"#"))
Sorry change the last part of the measure ,"#")) to ,"0.00")) for decimal
11 Replies
- DOLEARY85Resident RockstarHi,try this measure:Value Measure For Multiple Data Formats = IF(OR(CONTAINSSTRING(SELECTEDVALUE('TableName'[Tag_Description]),"(Euc)"),CONTAINSSTRING(SELECTEDVALUE('TableName'[Tag_Description]),"(Res/ARS)")),FORMAT(SUM('TableName'[Value])/100,"Percent"),FORMAT(SUM('TableName'[Value]),"#"))
- DOLEARY85Resident Rockstar
Sorry change the last part of the measure ,"#")) to ,"0.00")) for decimal
- MigasukeMemorable Member
Hi Rajeshcric424 ,
Check the following solution, where you use IF, SELECTEDVALUE and FORMAT together:
https://community.powerbi.com/t5/Power-Query/How-to-change-row-data-from-decimal-to-percentage/m-p/3108767#M99365 - elizabeth1New Member
Power BI Desktop is a business analytics service provided by Microsoft that allows users to create reports and visualizations using their data. I use this WordPress blog editor on my website 먹튀사이트 Power BI Desktop includes a wide range of features, one of which is the ability to create tables.
- Rajeshcric424Frequent Visitor
Thanks for your help, I am new to Power BI in learning phase. I have tried the measure but it showing the out as 0.31% and 0.12% not as 31% and 12%.
- DOLEARY85Resident RockstarTry removing the /100 part of the measure, that should give you 31.00% & 12.00%:Value Measure For Multiple Data Formats = IF(OR(CONTAINSSTRING(SELECTEDVALUE('Table'[Tag_Description]),"(Euc)"),CONTAINSSTRING(SELECTEDVALUE('Table'[Tag_Description]),"(Res/ARS)")),FORMAT(SUM('Table (3)'[Value]),"Percent"),FORMAT(SUM('Table (3)'[Value]),"0.00"))
- DOLEARY85Resident Rockstar
Also if you don't want the .00 after the percentage you can change "percent" to "0%" full measure below:
Value Measure For Multiple Data Formats = IF(OR(CONTAINSSTRING(SELECTEDVALUE('Table'[Tag_Description]),"(Euc)"),CONTAINSSTRING(SELECTEDVALUE('Table'[Tag_Description]),"(Res/ARS)")),FORMAT(SUM('Table'[Value]),"0%"),FORMAT(SUM('Table'[Value]),"0.00"))