Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a table as below. I am trying to create a column with percentage of yes column as excel formula.=(IF(B2="Yes", 0.25,0)+IF(C2="Yes",0.25,0)+IF(D2="Yes",0.25,0)+IF(E2="Yes",0.25,0))
ID A B C D expected column Score%
1 yes No yes No 50%
2 No No yes No 25%
3 No No No No 0%
Thank you for the help
Solved! Go to Solution.
let
Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjy0QElH6dCCytRiKMsvH7tQrE60khG6GnyKjXEqRmXExgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"ID " = _t, #"A " = _t, #" B " = _t, #"C " = _t, #"D " = _t]),
#"Modificato tipo" = Table.TransformColumnTypes(Origine,{{"ID ", Int64.Type}, {"A ", type text}, {" B ", type text}, {"C ", type text}, {"D ", type text}}),
#"Aggiunta colonna personalizzata" = Table.AddColumn(#"Modificato tipo", "pcYes", each Text.Format("#{0}%",{List.Count(List.FindText(Record.FieldValues(_),"yes"))*25}))
in
#"Aggiunta colonna personalizzata"
let
Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjy0QElH6dCCytRiKMsvH7tQrE60khG6GnyKjXEqRmXExgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"ID " = _t, #"A " = _t, #" B " = _t, #"C " = _t, #"D " = _t]),
#"Modificato tipo" = Table.TransformColumnTypes(Origine,{{"ID ", Int64.Type}, {"A ", type text}, {" B ", type text}, {"C ", type text}, {"D ", type text}}),
#"Aggiunta colonna personalizzata" = Table.AddColumn(#"Modificato tipo", "pcYes", each Text.Format("#{0}%",{List.Count(List.FindText(Record.FieldValues(_),"yes"))*25}))
in
#"Aggiunta colonna personalizzata"
Hello @sanjay009
You can apply same IF then Else logic in your m query Custom column, what is the issue you are getting? If possible share the dummy pbix.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
41 | |
23 | |
21 | |
21 | |
13 |