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.
Source Data:
I was able to use the list functions for each grouped table to get:
Min
Max
Mode
Average
Count
#"Customized" = Table.Group(#"Changed Type", "SN", {{ "Min", each List.Min([Value]), type number},
{"Max", each List.Max([Value]), type number},{"Mode", each List.Mode([Value]), type number},
{"Average", each List.Average([Value]), type number},{"Count", each List.Count([Value]), type number}},
GroupKind.Local, Comparer.OrdinalIgnoreCase)
List.Mode returns the value used most for each table, but what is the proper way to add another column to show the count of the mode value occurances for each table?
For example, adding another column showing count of the mode values:
SN Mode_Value_Occurance
a 2
b 4
Solved! Go to Solution.
Something like this should work (additional code in red):
#"Customized" = Table.Group(#"Changed Type", "SN", {{ "Min", each List.Min([Value]), type number}, {"Max", each List.Max([Value]), type number},{"Mode", each List.Mode([Value]), type number}, {"Average", each List.Average([Value]), type number},{"Count", each List.Count([Value]), type number},
{"Mode_Value_Occurrence",
each let mode = List.Mode([Value]) in List.Count(List.Select([Value], each _=mode)), Int64.Type}}, GroupKind.Local, Comparer.OrdinalIgnoreCase)
Admittedly, the Mode ends up being evaluated twice for each group, but if this performs well enough I wouldn't worry about it.
Regards,
Owen
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.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |