@Vladas
So if I understand correctly the Channel that is repeated the most is considered the main Channel - sound like a job for Power Query.
First added a counter column and a Table.Group step were all rows for each [OrderId] are collected:
Table.Group(#"Changed Type1", {"OrderId"}, {{"All Rows", each _, type table [OrderId=text, Channel=text, Number=number]}})
In the following step I summed the counter, sorted it decending and returned the first value:
Table.AddColumn(#"Grouped Rows", "Main Channel", each List.First( Table.Sort( Table.Group([All Rows], {"Channel"}, {{"Number", each List.Sum([Number]), type number}}), {{"Number", Order.Descending}})[Channel]), type text)
Finally I expanded All Rows again, so you,'re back to where you started if this is not necessary because you don’t need all rows in your model, you could delete that step. Here’s the full query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("7d1BT8IwGMbxr0J2NqTrBDbPRE5+AsJhMoJEzAwc+PoqF3Xp5qNurCv/hOMvrGMpbd+9b7tcRnFsjJ2beBybsTVxNjLm7vyJbqKHfLdfP+1eXqPVDRKJ9FzeuuR9vt48luXzVzhrHaZyI5FIJBKJ/KWM5aEQGZScIJFByKk4obZy50AOVS7KcrvfjPKiOJWH4uh5a7u7L9/8UH7n8GSLT9bKLUGGJOWhGBmUzJBhyGmW1USykchwpRYOQSKRjVIKJyP7lNo68SylGSAS2ZbMElOTc1EJ055hIn8lEolEeibfGRKJRCI/pRS26Uw6026Rw5RWfu7IlqX0wgGJ/FkmUsgKiUQikX+S1tpEK3hDIpFIJBKJRCJ9lkpqDBKJvLiUUguRSP+lkuCGDE5K5XFIJPLapPJ+E4lEIpFIZKAyUXJfkcge5MRO5sY5p/1ecgcEAoEDgM76Oxd0vqYAAj2H7ug0EBgMFA6/ALYI3YVdQGCr0F2JAAQCPYNpmtacQVUNISGRyCYpbT+BRCKRyH9IaXdTJBIZhpRKTZDIZpklVhxlkMiApNw79H6ERCKRF5LONNxKMFuFyTSrO4Ggcu3upHLnVy9jJbnVB6kUkiKRPUmpnBHZr1QOlOhOKmUuSGQPMv04bkVZ6yKRSOTVSGnjIiRSkdKqHNm+dK8RFmW53W9GeVGcykNx9Nk7VxkN3vn/1uCldS4Siby4FKoZk2w2087LRCL7ktKkG4lEDliu3gA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [OrderId = _t, Channel = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"OrderId", type text}, {"Channel", type text}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Channel", Order.Ascending}}),
#"Added Counter" = Table.AddColumn(#"Sorted Rows", "Number", each 1),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Counter",{{"Number", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type1", {"OrderId"}, {{"All Rows", each _, type table [OrderId=text, Channel=text, Number=number]}}),
#"Added Main Channel" = Table.AddColumn(#"Grouped Rows", "Main Channel", each List.First( Table.Sort( Table.Group([All Rows], {"Channel"}, {{"Number", each List.Sum([Number]), type number}}), {{"Number", Order.Descending}})[Channel]), type text),
#"Expanded All Rows if needed" = Table.ExpandTableColumn(#"Added Main Channel", "All Rows", {"Channel"}, {"Channel"})
in
#"Expanded All Rows if needed"
Now when the Main Channel is placed in the visual on the right, you can see it all adds up.
You can follow along with the steps in the query editor, I hope this helps.
OrderTable1.pbix (40.2 KB)
General advice, if you use this method be very explicit about it and get consensus from your stakeholders because you have changed the dataset.