Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi
I built the 2 matrix visual, first matric showing previous year calculation, 2nd matrix showing current last 3 months calculation where it has dynamic column headers in format mmm-yy.
When I tried to put them side by side, there is blank space coming, both matrixes are not aligned same way like tableau do. I tried changing the padding to 0, turned off boarders.
Structure of table is :- Hospital, previousyr, jun-25,jul-25,aug-25.
Is there any solution to show them as single table same as tableau does?
Thanks
Solved! Go to Solution.
Answered this question here - Solved: Re: How to align multiple tables and create dynami... - Microsoft Fabric Community
Hi @leodec11 ,
Thanks @Jihwan_Kim for sharing the detailed calculation group solution with screenshots and a pbix file. This approach should resolve the alignment issue you faced with two separate matrices, since everything can now be handled in a single matrix visual with dynamic MMM-YY headers.
@leodec11 did you get a chance to check out Jihwan’s solution? It looks like it should meet your requirement of
Specialty | PrevRatio | Jun-25 | Jul-25 | Aug-25 | CurrentRatio
all in one matrix without spacing problems.
If you are still unable to achieve the expected result, could you please share a small set of sample data along with some screenshots and, if possible, a pbix file? That will make it easier for the community to reproduce your scenario and guide you with a precise fix.
Thanks,
Akhil.
Hi,
I am not sure how your desired output looks like, but I tried to create a sample pbix file like below.
One of ways to achieve this is using Calculation Group.
Please check the below link to Microsoft Learn, pictures and the attached pbix file.
Create calculation groups in Power BI - Power BI | Microsoft Learn
condition =
VAR _previousyear =
MAXX (
FILTER ( ALL ( 'calendar' ), 'calendar'[Date] = TODAY () ),
'calendar'[Year]
) - 1
RETURN
SWITCH (
TRUE (),
MAX ( 'calendar'[Year] ) = _previousyear
&& NOT ISINSCOPE ( 'calendar'[Month-Year] ), CALCULATE ( SELECTEDMEASURE (), 'calendar'[Year] = _previousyear ),
ISINSCOPE ( 'calendar'[Month-Year] ),
VAR _t =
FILTER (
ALL ( 'calendar'[Month-Year sort], 'calendar'[Month-Year] ),
'calendar'[Month-Year sort] <= TODAY ()
)
VAR _last3months =
WINDOW ( 1, ABS, 3, ABS, _t, ORDERBY ( 'calendar'[Month-Year sort], DESC ) )
RETURN
CALCULATE ( SELECTEDMEASURE (), KEEPFILTERS ( _last3months ) )
)
Hi
the sample data in table, and added reult expected in picture
| Section | ClassRoom | YearMnth | DENO | NUMER |
| class AP | class A | 202506 | 2 | 23 |
| class AP | class A | 202506 | 1 | 10 |
| class AP | class A | 202506 | 5 | 34 |
| class AP | class A | 202506 | 1 | 8 |
| class AP | class A | 202506 | 4 | 28 |
| class AP | class A | 202506 | 10 | 34 |
| class AP | class A | 202506 | 2 | 28 |
| class AP | class A | 202506 | 3 | 30 |
| class AP | class A | 202506 | 8 | 56 |
| class AP | class A | 202506 | 1 | 1 |
| class AP | class A | 202506 | 1 | 48 |
| class R | class A | 202506 | 5 | 33 |
| class R | class A | 202506 | 9 | 76 |
| class R | class A | 202507 | 8 | 71 |
| class NM | class A | 202506 | 2 | 17 |
| class NM | class A | 202506 | 1 | 10 |
| class NM | class A | 202507 | 2 | 27 |
| class NM | class A | 202507 | 5 | 36 |
| class HE | class A | 202506 | 5 | 50 |
| class HE | class A | 202506 | 1 | 7 |
| class HE | class A | 202506 | 3 | 30 |
| class HE | class A | 202506 | 3 | 29 |
| class HE | class A | 202507 | 1 | 10 |
| class N | class A | 202506 | 2 | 27 |
| class N | class A | 202506 | 1 | 10 |
| class N | class A | 202506 | 2 | 6 |
| class N | class A | 202506 | 1 | 10 |
| class N | class A | 202506 | 2 | 27 |
.
I have built below column
Hi,
Share the download link of the Excel file with your formulas written there so that i can understand how you arrived at those results. I will convert those formulas into DAX measures.
If possible can @Jihwan_Kim super user look into this for me, can't upload real dataset, so adding random numbers. Business requirement is to show previous year ratio which is numer/deno by section, classroom, for which i built baseratio column has calculation Numer/Deno, next 3 columns needs to have dynamic headers for last 3 months in MMM-YY format, for dynamic header built Last3months table. last column needs to be YTD. I built 3 matrixes same as we do in tableau and put aligned the all 3 matrixes side by side but in PBI it is showing space between matrix. As Super User suggested to use calculation group which erase the usage of individual matrix table. Sample data (RandomNumbers), FinalTableFormat Expected(RandomNumbers)
| Section | PrevYr | Jun-25 | Jul-25 | Aug-25 | YTD |
| class R | 4.5 | 5.7 | 4.5 | 2.3 | 3.4 |
| class AP | 3.4 | 6.9 | 3.4 | 2.5 | 4.6 |
| class HE | 2.5 | 3.8 | 2.9 | 2.4 | 1.4 |
| class NM | 5.8 | 2.5 | 1.8 | 2.5 | 2.3 |
| class N | 7.5 | 2 | 3.9 | 3.9 | 2.5 |
| Section | ClassRoom | YearMnth | DENO | NUMER |
| class AP | class A | 202506 | 2 | 23 |
| class AP | class A | 202506 | 1 | 48 |
| class R | class A | 202506 | 5 | 33 |
| class R | class A | 202507 | 8 | 71 |
| class NM | class A | 202506 | 2 | 17 |
| class NM | class A | 202506 | 1 | 10 |
| class HE | class A | 202506 | 5 | 50 |
| class HE | class A | 202506 | 1 | 7 |
| class N | class A | 202506 | 1 | 10 |
| class N | class A | 202506 | 2 | 6 |
Report Date =
DATE (
DIVIDE ( 'test'[YearMnth], 100, 0 ), -- Year
MOD ( 'test'[YearMnth], 100 ), -- Month
1 -- First day
)
Measure :
BaseRatio =
DIVIDE (
SUM ( 'test'[NUMER] ),
SUM ( 'test'[DENO] )
)
Disconnected Table :-
Last3Months =
VAR MaxMonth = EOMONTH(TODAY(), -1) // last month
RETURN
ADDCOLUMNS(
CALENDAR(EOMONTH(MaxMonth,-2)+1, MaxMonth),
"MMM-YY", FORMAT([Date], "MMM-yy")
)
Calculation group :-
condition =
VAR _previousyear =
MAXX (
FILTER ( ALL ( 'calendar' ), 'calendar'[Date] = TODAY () ),
'calendar'[Year]
) - 1
RETURN
SWITCH (
TRUE (),
MAX ( 'calendar'[Year] ) = _previousyear
&& NOT ISINSCOPE ( 'calendar'[Month-Year] ), CALCULATE ( SELECTEDMEASURE (), 'calendar'[Year] = _previousyear ),
ISINSCOPE ( 'calendar'[Month-Year] ),
VAR _t =
FILTER (
ALL ( 'calendar'[Month-Year sort], 'calendar'[Month-Year] ),
'calendar'[Month-Year sort] <= TODAY ()
)
VAR _last3months =
WINDOW ( 1, ABS, 3, ABS, _t, ORDERBY ( 'calendar'[Month-Year sort], DESC ) )
RETURN
CALCULATE ( SELECTEDMEASURE (), KEEPFILTERS ( _last3months ) )
)
Answered this question here - Solved: Re: How to align multiple tables and create dynami... - Microsoft Fabric Community
Hi @leodec11 ,
Thank you @Ashish_Mathur , for your workable solution,
@leodec11 please go through the URL shared by Ashish mathur, it will be solve your issue.
Thanks,
Akhil.
Hi @leodec11 ,
Did you get a chance to review the link provided? Let us know if that resolves your issue or if you are still facing any challenges.
Thanks,
Akhil.
Hello @leodec11
To better understand the request, can you please provide some visual images?
As per my understanding, you can put all the measures in a single matrix visual, you don't need 2 matrix to show, unless it is a business requirement.
Hi
thanks for replying.
table structure is
Specialty | PrevRatio | Jun-25 | Jul-25 | Aug-25 | CurrentRatio |,
the major problem is last 3 months dynamic headers, DAX measure built to show last 3 months ratio like this
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.