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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
infantpowerbi
Helper II
Helper II

Convert the Value into Percentage based on condition

Dear All,


I am infant topower bi and facing some challenges due to being new to power bi

I am holding data in below format

Company        Q2 FY 2018  Q3 FY 2018         Q4 FY 2018  Q1 FY 2019  
X                           0                   0                          0                  0         
Y                           0                   0                          0                  0         
Z                      0.9920229         0.99202292         10.00%         99%

But when I make table in Desktop power bi company Z values should convert into percentage.
Can any one please help me how can I make it         

1 ACCEPTED SOLUTION

Hi @infantpowerbi ,

Can you use calculated column? If yes,  you can try the formula below. If not, I think you need to convert the Value column to percentage entirely.

 

Z Percentage = IF('Table'[Company] = "Z",FORMAT('Table'[Value],"00.00%"))

1.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @infantpowerbi ,

If you just want to convert the values of Z to percentage and others show decimal number, you need to unpivot the table in Query Editor.

1. Unpivot columns

4.PNG

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WilDSUTJAwbE60UqRWEWjQCw9S0sjAyMjS2S2EZhjCBVSio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Company = _t, #"Q2 FY 2018" = _t, #"Q3 FY 2018" = _t, #"Q4 FY 2018" = _t, #"Q1 FY 2019" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Company", type text}, {"Q2 FY 2018", type number}, {"Q3 FY 2018", type number}, {"Q4 FY 2018", type number}, {"Q1 FY 2019", type number}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Company"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

2. Apply and then create a measure

Measure = CALCULATE(FORMAT(SUM('Table'[Value]),"00.00%"),FILTER('Table','Table'[Company] = "Z"))

5.PNG

If you want to all the values shown as percentage, you could click % in Modeling tab.

6.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,
My client denied to use measure,
So can we convert value column into percentage where company is equal to z

Hi @infantpowerbi ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @infantpowerbi ,

Can you use calculated column? If yes,  you can try the formula below. If not, I think you need to convert the Value column to percentage entirely.

 

Z Percentage = IF('Table'[Company] = "Z",FORMAT('Table'[Value],"00.00%"))

1.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.