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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
sivasrao
Helper III
Helper III

Merge Cells

Hi Everyone,

How can I get the same as the below image by using Power BI?

IMG-20221114-WA0003.jpg

How can merge the cells like in as above image?

Thank you.

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Assuming you have a fact table like the following:

ftable.jpgCreate dimension tables for mood and state including a sorting order column using:

Mood table = 
SELECTCOLUMNS(
    DISTINCT('Table'[Mood]), "dMood", 'Table'[Mood],
    "Order", 
    SWITCH(TRUE(),
    CONTAINSSTRING('Table'[Mood], "Very"), 1,
    CONTAINSSTRING('Table'[Mood], "Neut"), 2,
    3))

Mood toable.jpg

State table = 
SELECTCOLUMNS(
    DISTINCT(
        'Table'[State]),
        "dState", 'Table'[State],
        "Order",
        SWITCH(TRUE(),
        CONTAINSSTRING('Table'[State], "I ag"), 1,
        CONTAINSSTRING('Table'[State], "Strongly ag"), 2,
        CONTAINSSTRINGEXACT('Table'[State], "Satisfied"), 3,
        CONTAINSSTRINGEXACT('Table'[State], "Strongly satisfied"), 4,
        CONTAINSSTRING('Table'[State], "More"), 5,
        CONTAINSSTRING('Table'[State], "I dis"), 6,
        CONTAINSSTRING('Table'[State], "Strongly dis"), 7,
        CONTAINSSTRING('Table'[State], "Strongly uns"), 8,
        10))

State table.jpgSort the mood and state fields by the orders columns using this method:

sort.gif

Create one-to-many relationships between the dimension tables and the corresponding fields in the fact table. The model looks like this:

model.jpgCreate a matrix using the fields from the dimension table and the item field in the rows bucket. Expand all levels and under Row headers in the formatting pane turn off the +/- icons and turn off stepped layout under options

matrix.gif

 Sample PBIX file attached





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

Assuming you have a fact table like the following:

ftable.jpgCreate dimension tables for mood and state including a sorting order column using:

Mood table = 
SELECTCOLUMNS(
    DISTINCT('Table'[Mood]), "dMood", 'Table'[Mood],
    "Order", 
    SWITCH(TRUE(),
    CONTAINSSTRING('Table'[Mood], "Very"), 1,
    CONTAINSSTRING('Table'[Mood], "Neut"), 2,
    3))

Mood toable.jpg

State table = 
SELECTCOLUMNS(
    DISTINCT(
        'Table'[State]),
        "dState", 'Table'[State],
        "Order",
        SWITCH(TRUE(),
        CONTAINSSTRING('Table'[State], "I ag"), 1,
        CONTAINSSTRING('Table'[State], "Strongly ag"), 2,
        CONTAINSSTRINGEXACT('Table'[State], "Satisfied"), 3,
        CONTAINSSTRINGEXACT('Table'[State], "Strongly satisfied"), 4,
        CONTAINSSTRING('Table'[State], "More"), 5,
        CONTAINSSTRING('Table'[State], "I dis"), 6,
        CONTAINSSTRING('Table'[State], "Strongly dis"), 7,
        CONTAINSSTRING('Table'[State], "Strongly uns"), 8,
        10))

State table.jpgSort the mood and state fields by the orders columns using this method:

sort.gif

Create one-to-many relationships between the dimension tables and the corresponding fields in the fact table. The model looks like this:

model.jpgCreate a matrix using the fields from the dimension table and the item field in the rows bucket. Expand all levels and under Row headers in the formatting pane turn off the +/- icons and turn off stepped layout under options

matrix.gif

 Sample PBIX file attached





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown 

Is any chance to insert some emojis based on dmood column data?

Ex: Very Happy: 😀

     Not Happy: 😔

     Neutral: 🙂

 

Thank you.

Great.

Thank you for the solution.😄👌

 

vanessafvg
Community Champion
Community Champion

just use a matrix visual and stack your columns

very happy will be your first column

agree disagree etc will be your second column

 

stack them on top of each other in the rows section

 

its helpful if you show a sample of your data.

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.