Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Rajeshcric424
Frequent Visitor

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.

 

Rajeshcric424_0-1680294616717.png

 

Output: 

Tag_DescriptionValue
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

 

2 ACCEPTED SOLUTIONS
DOLEARY85
Super User
Super User

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]),"#"))

View solution in original post

Sorry change the last part of the measure ,"#")) to ,"0.00")) for decimal

View solution in original post

11 REPLIES 11
Rajeshcric424
Frequent 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%.

Try 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"))

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"))

Hi This is measure is working good showing values 31% and 12%. but all the values are showing empty. 

Rajeshcric424_0-1680515556118.png

 

In my table ther are only five stock tank B2 but all the others it is showing as Stocktank B2 and empty. same for values taking for all the columns after applying the measure

 

example:

there five rows in table one row is stock tank B2 . it chnage the value for 31% for paticular rows. it shwoing five rows with stcok tank B2 and one 31% others empty

Without seeing more of what is in the file it's going to be difficult to tell why that's happening. Have you got a copy of the PBI file i can take a look at?

This measure is working fine now. Thanks a Lot. How to do as New column without the measure. Is it Possible.

I believe due to the different formats you want within a single column it will need to be a measure. 

elizabeth1
New 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.

DOLEARY85
Super User
Super User

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

Migasuke
Super User
Super User

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/3...

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.