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.
Hello,
I have data in an excel file wherein the Overall Percentage should be 100%.
I want to compute that if for example, the Column F is NO, then the Overall Percentage should be multiplied by 0.5, but if YES then just 0.
Also, if there is a value in Column G(Name), then another multiply the Overall Percentage by 0.15.
For every input in Column H-I, if it has any value, then it should be multiplied by 0.075 from the Overall Percentage also.
How to put the formula in Powerbi? I need to put it in a bar graph in PowerBI
This is the formula if it's in excel
=(1-((IF(F2="NO",0.5,0))+(COUNTA(G2)*0.15)+(COUNTA(H2,I2)*0.075)*0.05)))/1
Solved! Go to Solution.
Hi, @unichan_jk ;
You could try to create a custom column.
=1-(if [found]="NO" then 0.5 else 0)-(List.NonNullCount({[Name]})*0.15)-(List.NonNullCount({[age],[Address]})*0.075*0.05)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WqijNLVDSUTI0MjQ2NDIGsopSS4AIyDDVN9U3MjAyAjLLU1OzFQyBjMjUYiAJVg8k8kpzciBcMyM9UwNVpVidaKWSjEywiabGJsamIANLUmHmGeE2D8U0c5BRsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Code = _t, Number = _t, ID = _t, #"date processed" = _t, #"audit week" = _t, found = _t, Name = _t, age = _t, Address = _t, Info = _t, #"overall " = _t]),
#"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Name", "age", "Address", "Info"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Code", type text}, {"Number", Int64.Type}, {"ID", type text}, {"date processed", type date}, {"audit week", type text}, {"found", type text}, {"Name", type text}, {"age", Int64.Type}, {"Address", Int64.Type}, {"Info", type text}, {"overall ", Percentage.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each 1-(if [found]="NO" then 0.5 else 0)-(List.NonNullCount({[Name]})*0.15)-(List.NonNullCount({[age],[Address]})*0.075*0.05))
in
#"Added Custom"
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @unichan_jk ;
You could try to create a custom column.
=1-(if [found]="NO" then 0.5 else 0)-(List.NonNullCount({[Name]})*0.15)-(List.NonNullCount({[age],[Address]})*0.075*0.05)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WqijNLVDSUTI0MjQ2NDIGsopSS4AIyDDVN9U3MjAyAjLLU1OzFQyBjMjUYiAJVg8k8kpzciBcMyM9UwNVpVidaKWSjEywiabGJsamIANLUmHmGeE2D8U0c5BRsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Code = _t, Number = _t, ID = _t, #"date processed" = _t, #"audit week" = _t, found = _t, Name = _t, age = _t, Address = _t, Info = _t, #"overall " = _t]),
#"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Name", "age", "Address", "Info"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Code", type text}, {"Number", Int64.Type}, {"ID", type text}, {"date processed", type date}, {"audit week", type text}, {"found", type text}, {"Name", type text}, {"age", Int64.Type}, {"Address", Int64.Type}, {"Info", type text}, {"overall ", Percentage.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each 1-(if [found]="NO" then 0.5 else 0)-(List.NonNullCount({[Name]})*0.15)-(List.NonNullCount({[age],[Address]})*0.075*0.05))
in
#"Added Custom"
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.