Forum Discussion
Adjacent column groups in matrix
- Anonymous7 years ago
Hi Anonymous,
You can refer to following calculate table formula to create a new table with original table records and summarize table records:
Table = UNION ( 'Sample', SELECTCOLUMNS ( SUMMARIZE ( 'Sample', [Land], [Stad], [geslacht], "leeftijdgroep", [geslacht], "Aantal", SUM ( 'Sample'[Aantal] ) ), "Client", BLANK (), "Land", [Land], "Stad", [Stad], "geslacht", [geslacht], "leeftijdgroep", [leeftijdgroep], "Aantal", [Aantal] ) )After these, you can create a table as custom sort order table to define column order.(you can't direct change sort order of matrix column fields)
Sort Table = SELECTCOLUMNS ( VALUES ( 'Table'[leeftijdgroep] ), "leeftijdgroep", [leeftijdgroep], "Index", SWITCH ( [leeftijdgroep], "M", 1, "V", 2, "18-30", 3, "31-50", 4, "51-65", 5, BLANK () ) )Build relationship from new table to sort table, then create matrix visual.
Regards,
Xiaoxin Sheng
Hi Anonymous,
You can refer to following calculate table formula to create a new table with original table records and summarize table records:
Table =
UNION (
'Sample',
SELECTCOLUMNS (
SUMMARIZE (
'Sample',
[Land],
[Stad],
[geslacht],
"leeftijdgroep", [geslacht],
"Aantal", SUM ( 'Sample'[Aantal] )
),
"Client", BLANK (),
"Land", [Land],
"Stad", [Stad],
"geslacht", [geslacht],
"leeftijdgroep", [leeftijdgroep],
"Aantal", [Aantal]
)
)
After these, you can create a table as custom sort order table to define column order.(you can't direct change sort order of matrix column fields)
Sort Table =
SELECTCOLUMNS (
VALUES ( 'Table'[leeftijdgroep] ),
"leeftijdgroep", [leeftijdgroep],
"Index", SWITCH (
[leeftijdgroep],
"M", 1,
"V", 2,
"18-30", 3,
"31-50", 4,
"51-65", 5,
BLANK ()
)
)
Build relationship from new table to sort table, then create matrix visual.
Regards,
Xiaoxin Sheng
- Anonymous7 years agoNot applicable
Thank you, it looks like this is going to solve the problem!