Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello..
I have a table such as below. I want to subtract the failed call from the total call and put the result in a new row (success_call).
Can anyone who has information about this subject help me?
Call Type | Count | |
total_call | 10000 | |
Failed_call | 100 | |
Success_Call | 9900 | new rows |
Solved! Go to Solution.
Hi @u4us1923, you can do this easily in Excel but here you go:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKskvScyJT07MyVHSUTI0AAKlWJ1oJbfEzJzUFCRxpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Call Type" = _t, Count = _t]),
ChangedType = Table.TransformColumnTypes(Source,{{"Count", type number}}),
Ad_SuccessCall_Row = Table.InsertRows(ChangedType, 2, {
[ Call Type = "Success_Call",
Count = [ t = Table.SelectRows(ChangedType, (x)=> Text.Contains(x[Call Type], "total", Comparer.OrdinalIgnoreCase))[Count]{0}?,
f = Table.SelectRows(ChangedType, (x)=> Text.Contains(x[Call Type], "failed", Comparer.OrdinalIgnoreCase))[Count]{0}?,
result = t-f
][result]
] } )
in
Ad_SuccessCall_Row
Hi @u4us1923, you can do this easily in Excel but here you go:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKskvScyJT07MyVHSUTI0AAKlWJ1oJbfEzJzUFCRxpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Call Type" = _t, Count = _t]),
ChangedType = Table.TransformColumnTypes(Source,{{"Count", type number}}),
Ad_SuccessCall_Row = Table.InsertRows(ChangedType, 2, {
[ Call Type = "Success_Call",
Count = [ t = Table.SelectRows(ChangedType, (x)=> Text.Contains(x[Call Type], "total", Comparer.OrdinalIgnoreCase))[Count]{0}?,
f = Table.SelectRows(ChangedType, (x)=> Text.Contains(x[Call Type], "failed", Comparer.OrdinalIgnoreCase))[Count]{0}?,
result = t-f
][result]
] } )
in
Ad_SuccessCall_Row
User | Count |
---|---|
11 | |
7 | |
5 | |
5 | |
4 |
User | Count |
---|---|
16 | |
14 | |
8 | |
6 | |
6 |