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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
leodec11
Regular Visitor

How to align multiple tables and create dynamic last 3 months columns when migrating from Tableau

I am trying to migrate a Tableau dashboard to Power BI, and I’m having difficulty building the tables in the desired format.

I currently have 3 separate tables:

  • Matrix table – showing Classroom, Section, and PreviousYrRatio.
  • Last 3 months table – showing dynamic months (e.g., Jun-25, Jul-25, Aug-25).
  • YTD table – showing year-to-date values.

When I place these 3 tables side by side on the Power BI page, empty space appears between them, and alignment becomes difficult.

I also tried creating a calculation group with 3 columns (PreviousYrRatio, Last 3 Months, YTD), but the issue is that the “Last 3 Months” values appear as a single column instead of showing 3 dynamic month columns with headers.

Question:- How can I build this in Power BI so that the 3 sections (classroom,section,PreviousYrRatio, Jun-25, Jul-25, Aug-25, YTD) appear in one aligned table, with the last 3 months shown as separate dynamic columns?

2 ACCEPTED SOLUTIONS

Hi,

This is a start

Ashish_Mathur_0-1758165278009.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Hi,

Click on the hierarch symbol.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Poojara_D12
Super User
Super User

Hi @leodec11 

What you are trying to replicate is essentially a single pivot-style matrix where different measures (PreviousYrRatio, YTD) sit alongside dynamic month columns, but Power BI doesn’t allow you to simply stitch three independent visuals together without spacing or alignment issues. Placing separate tables side by side leads to the gaps you’re seeing, and calculation groups alone won’t create multiple dynamic columns—they return one column at a time. The best practice here is to restructure your model so that you can use a single Matrix visual: keep Classroom and Section as row headers, then unpivot your measures so that you can display them in columns. For the “Last 3 Months,” you can create a measure that returns values for the current month, prior month, and two months back, then use a disconnected Date table or a DAX pattern with SELECTEDVALUE/SWITCH to generate separate measures for each month, ensuring they appear as three distinct dynamic columns with proper headers (e.g., Jun-25, Jul-25, Aug-25). In other words, you’ll need to align everything in one Matrix visual with carefully designed DAX measures or a combination of calculation groups and measure branching, rather than trying to combine multiple visuals. This way, the final output is a single table with Classroom, Section, PreviousYrRatio, each of the last 3 months as separate columns, and YTD, all properly aligned.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
Greg_Deckler
Community Champion
Community Champion

@leodec11 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Sample data is in the format 

YRMNTHspecnumerdeno
202402IT210
202506FP324
202506FP432
202402IT212
202507FP145
202506IT212
202508FP323

Result Expected where jun-2025, jul-2025,aug-2025 is dynamic column header showing last 3 months from current date. Basic calculation is numer/deno for each spec

specPreviousYearJun-2025Jul-2025Aug-2025YTD
FP00.1250.02220.130.088
IT0.180.16000.16

Hi,

This is a start

Ashish_Mathur_0-1758165278009.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur, thanks for sharing the pbix file, i am able to replicate the calculations but while displaying i am getting column as spec, ratio PY, Ratio, Ratio YTD in your pbix file as well.. can you tell how did you create the matrix table, it might be i missed something. see the screenshot attached.scr1.png

Hi,

Click on the hierarch symbol.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors