Repeated rows with multiple different panels in them are not grouped

Using Grafana v9.2.6 on Ubuntu

I have two repeated rows and they are one below the other with multiple panels for each row.
Let’s say the row have titles as ‘A’ and B’, then they are displayed in the dashboard as:
A
B

These two rows are repeated for the same variable and when multiple values (eg, 2) for the variable are selected from filter, the display is:
A
A
B
B

But I want this to be:
A
B
A
B

I am new to using Grafana and tried merging two rows in a single row, but was unsuccessfull
Please help me on how I can achieve this.
Thanks