Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 (mode value "2" occurs 2 times.)
b 4 (mode value "3" occurs 4 times.)
Solved! Go to Solution.
Hi @roncruiser ,
I process that by DAX here. Please refer to the formula of the calculated table.
Table = SUMMARIZE ( Table1, Table1[SN], "min", MIN ( Table1[Value] ), "max", MAX ( Table1[Value] ), "mode", MINX ( TOPN ( 1, ADDCOLUMNS ( VALUES ( Table1[Value] ), "Frequency", CALCULATE ( COUNT ( Table1[Value] ) ) ), [Frequency], 0 ), Table1[Value] ), "average", AVERAGE ( Table1[Value] ), "count", COUNTROWS ( Table1 ), "count1", CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, Table1[Value] = MINX ( TOPN ( 1, ADDCOLUMNS ( VALUES ( Table1[Value] ), "Frequency", CALCULATE ( COUNT ( Table1[Value] ) ) ), [Frequency], 0 ), Table1[Value] ) ) ) )
Regards,
Frank
Hi @roncruiser ,
I process that by DAX here. Please refer to the formula of the calculated table.
Table = SUMMARIZE ( Table1, Table1[SN], "min", MIN ( Table1[Value] ), "max", MAX ( Table1[Value] ), "mode", MINX ( TOPN ( 1, ADDCOLUMNS ( VALUES ( Table1[Value] ), "Frequency", CALCULATE ( COUNT ( Table1[Value] ) ) ), [Frequency], 0 ), Table1[Value] ), "average", AVERAGE ( Table1[Value] ), "count", COUNTROWS ( Table1 ), "count1", CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, Table1[Value] = MINX ( TOPN ( 1, ADDCOLUMNS ( VALUES ( Table1[Value] ), "Frequency", CALCULATE ( COUNT ( Table1[Value] ) ) ), [Frequency], 0 ), Table1[Value] ) ) ) )
Regards,
Frank
@roncruiser Just want to confirm, whether you just want to show the highest occurances value only within a group or each value and it's number of occurances.
Proud to be a PBI Community Champion
Now, that I think about it more. It would be move valuable to show occurences for each value in each group with the option within the Mcode to show only the mode occurence. Showing a single value versus for all the values within the group for the sake of load times into the data model.
Thank you.
Hi @roncruiser ,
Did you have a chance to check my way?
Regards,
Frank
I have not had that chance yet. But I will. Got pulled aside and tasked to something else at the moment. This forum and the community is extremely valuable and helpful for the occasional dabbler like me.
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |