Forum Discussion
Min, max and Avg Row
- 5 years ago
Anonymous ,
min A = Calculate(min(Table[A]),allselected(Table))
Max A = Calculate(Amx(Table[A]),allselected(Table))
And So on.
Another way is unpivoting the data A,B,C are the values of New Column Col1 (With A,b ,C), Value with Value
https://radacad.com/pivot-and-unpivot-with-power-bi
min = Calculate(min(Table[Value]),allexcept(Table,Table[Col1]))max = Calculate(max(Table[Value]),allexcept(Table,Table[Col1]))
Avg= Calculate(Average(Table[Value]),allexcept(Table,Table[Col1]))
display with Show on row in matrix
https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/
- 5 years ago
Anonymous - You can either unpivot those columns or use MC Aggregations
- Anonymous5 years ago
Hi Anonymous,
I also think unpivoted columns should be a simple way to achieve your requirement.
If you not want to change your structure, you can try to use following calculate table formula. (I hard code these values into formulas and manually append these aggregated rows)Table= VAR temp = SELECTCOLUMNS ( { "Min", "Max", "Avg" }, "Region", [Value], "A", SWITCH ( [Value], "Min", MINX ( ALL ( 'Table'[A] ), [A] ), "Max", MAXX ( ALL ( 'Table'[A] ), [A] ), "Avg", AVERAGEX ( ALL ( 'Table'[A] ), [A] ) ), "B", SWITCH ( [Value], "Min", MINX ( ALL ( 'Table'[B] ), [B] ), "Max", MAXX ( ALL ( 'Table'[B] ), [B] ), "Avg", AVERAGEX ( ALL ( 'Table'[B] ), [B] ) ), "C", SWITCH ( [Value], "Min", MINX ( ALL ( 'Table'[C] ), [C] ), "Max", MAXX ( ALL ( 'Table'[C] ), [C] ), "Avg", AVERAGEX ( ALL ( 'Table'[C] ), [C] ) ) ) RETURN UNION ( 'Table', temp )Regards,
Xiaoxin Sheng
Anonymous ,
min A = Calculate(min(Table[A]),allselected(Table))
Max A = Calculate(Amx(Table[A]),allselected(Table))
And So on.
Another way is unpivoting the data A,B,C are the values of New Column Col1 (With A,b ,C), Value with Value
https://radacad.com/pivot-and-unpivot-with-power-bi
min = Calculate(min(Table[Value]),allexcept(Table,Table[Col1]))
max = Calculate(max(Table[Value]),allexcept(Table,Table[Col1]))
Avg= Calculate(Average(Table[Value]),allexcept(Table,Table[Col1]))
display with Show on row in matrix
https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/