Forum Discussion
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?
Hi,
This is a start
Hi,
Click on the hierarch symbol.
6 Replies
- Greg_Deckler
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.- leodec11Frequent Visitor
Sample data is in the format
YRMNTH spec numer deno 202402 IT 2 10 202506 FP 3 24 202506 FP 4 32 202402 IT 2 12 202507 FP 1 45 202506 IT 2 12 202508 FP 3 23 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
spec PreviousYear Jun-2025 Jul-2025 Aug-2025 YTD FP 0 0.125 0.0222 0.13 0.088 IT 0.18 0.16 0 0 0.16 - Ashish_Mathur
Super User
- Poojara_D12
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.