Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tomperro
Helper III
Helper III

Adding a customized column group in table matrix

Is there a way to add a customized column group in table matrix similar to the image below?

 

tomperro_0-1718650009036.png

 

The counts are all measures.

2 ACCEPTED SOLUTIONS
Daniel29195
Super User
Super User

@tomperro this needs you to create a custom table with the intended structure. 

col1 with values : selected 6 months period ,  selected 6 month period vs previous 6 montth period. 

col2  with values : the name of the measures. 

 

then drag and drop them into the matrix in the columns. 

create one measure with switch statement : 

switch 

true() ,

selectedvalue col2 = measure1 , [ measure1]  , 

selectedvalue col2 = measure2 , [ measure2]  , 

...

 

let me know if this helps. 

 

 

View solution in original post

v-huijiey-msft
Community Support
Community Support

Hi @tomperro ,

 

Thanks for the reply from @Daniel29195 .

 

Here's the example data I created:

Test Type

Column1

Column2

111

1

18

222

2

17

333

3

16

444

4

15

555

5

14

666

6

13

777

7

12

888

8

11

999

9

10

 

Create a few simple measures:

A1 = AVERAGE('Table'[Column1])

A2 = COUNT('Table'[Column2])

B1 = SUM('Table'[Column1])

B2 = SUM('Table'[Column2])

 

Create a table:

Table 2 = CROSSJOIN(VALUES('Table'[Test Type]),{"Group A", "Group B"})

vhuijieymsft_0-1718678238992.png

 

Create two measures that serve to group A1 and B1 into Group A and A2 and B2 into Group B.

Measure = 
SWITCH(
    TRUE(),
    MAX('Table 2'[Value])="Group A",CALCULATE([A1],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type]))),
    MAX('Table 2'[Value])="Group B",CALCULATE([A2],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type])))
)

Measure 2 = 
SWITCH(
    TRUE(),
    MAX('Table 2'[Value])="Group A",CALCULATE([B1],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type]))),
    MAX('Table 2'[Value])="Group B",CALCULATE([B2],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type])))
)

 

Using the matrix visual object for display, the final page visualization is shown below:

vhuijieymsft_1-1718678238998.png

 

If this doesn't help you solve the problem. I would be grateful if you could provide me with the pbix file or sample data.

 

Remember to remove sensitive data and do not log in to your account in Power BI Desktop when uploading the pbix file.

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

2 REPLIES 2
v-huijiey-msft
Community Support
Community Support

Hi @tomperro ,

 

Thanks for the reply from @Daniel29195 .

 

Here's the example data I created:

Test Type

Column1

Column2

111

1

18

222

2

17

333

3

16

444

4

15

555

5

14

666

6

13

777

7

12

888

8

11

999

9

10

 

Create a few simple measures:

A1 = AVERAGE('Table'[Column1])

A2 = COUNT('Table'[Column2])

B1 = SUM('Table'[Column1])

B2 = SUM('Table'[Column2])

 

Create a table:

Table 2 = CROSSJOIN(VALUES('Table'[Test Type]),{"Group A", "Group B"})

vhuijieymsft_0-1718678238992.png

 

Create two measures that serve to group A1 and B1 into Group A and A2 and B2 into Group B.

Measure = 
SWITCH(
    TRUE(),
    MAX('Table 2'[Value])="Group A",CALCULATE([A1],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type]))),
    MAX('Table 2'[Value])="Group B",CALCULATE([A2],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type])))
)

Measure 2 = 
SWITCH(
    TRUE(),
    MAX('Table 2'[Value])="Group A",CALCULATE([B1],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type]))),
    MAX('Table 2'[Value])="Group B",CALCULATE([B2],FILTER('Table','Table'[Test Type]=MAX('Table 2'[Test Type])))
)

 

Using the matrix visual object for display, the final page visualization is shown below:

vhuijieymsft_1-1718678238998.png

 

If this doesn't help you solve the problem. I would be grateful if you could provide me with the pbix file or sample data.

 

Remember to remove sensitive data and do not log in to your account in Power BI Desktop when uploading the pbix file.

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Daniel29195
Super User
Super User

@tomperro this needs you to create a custom table with the intended structure. 

col1 with values : selected 6 months period ,  selected 6 month period vs previous 6 montth period. 

col2  with values : the name of the measures. 

 

then drag and drop them into the matrix in the columns. 

create one measure with switch statement : 

switch 

true() ,

selectedvalue col2 = measure1 , [ measure1]  , 

selectedvalue col2 = measure2 , [ measure2]  , 

...

 

let me know if this helps. 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.