Forum Discussion
How to align multiple tables and create dynamic last 3 months columns when migrating from Tableau
- 1 year ago
Hi,
This is a start
- 1 year ago
Hi,
Click on the hierarch symbol.
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.