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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
cheid
Frequent Visitor

Grouping Columns

I have data that is being imported via an API connection.  There are no measures, just data that I pull in to make the table below minus the headers containing the dates.  In power bi I would like to group all the columnsso that I can create headers (Current, Next, and Future + date) as shown in the screenshot.  Is there anyway to replicate the header (current, next, and future) in power bi matrix or table by grouping or creating a dynamic measure for each column?

 

cheid_0-1766109672951.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@cheid , with Calculation group you can get static-> Current Period, Past Period and Future period 

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

7 REPLIES 7
v-tejrama
Community Support
Community Support

Hi @cheid ,

 

Thank you @HarishKM and @DanieleUgoCopp  for the response provided!

Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

Thank you.

Hi @cheid ,

 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

Thank you.

DanieleUgoCopp
Resolver II
Resolver II

If the data already comes in with 10 fixed columns and you don’t want to reshape it, then the important thing to know is that Power BI can’t literally “group” columns the way Excel does. That feature just doesn’t exist for a normal table.

What you can do instead is use a Matrix visual. A matrix allows you to fake grouped headers by using a column hierarchy. You create a small helper field (for example with Enter Data or a calculated column) that says which group each column belongs to, like Current, Next, or Future. Then you place that grouping field above the actual column field in the Columns area of the matrix.

Visually, this gives you the effect of grouped headers even though the underlying columns are still separate. It only works in a Matrix, not in a Table, and it’s more about presentation than real column grouping.

HarishKM
Memorable Member
Memorable Member

@cheid Hey,
Best practice recommeded by me as below.

 

Best-practice (recommended)

  • Unpivot your date columns to a tidy “long” table


- Power Query: select all date columns → Transform → Unpivot Columns
- Result: [Entity…], [Date], [Value]

  • Add a Date table, relate it to the unpivoted [Date]
  • Create a bucket (Current/Next/Future) driven by an “as-of” date


- Optional slicer table AsOf[Date] (single select; default TODAY())
- Bucket (calculated column in Date table):
Bucket =
VAR asof = COALESCE(SELECTEDVALUE(AsOf[Date]), TODAY())
RETURN
SWITCH(TRUE(),
'Date'[Date] = asof, "Current",
'Date'[Date] = EDATE(asof, 1), "Next",
'Date'[Date] > EDATE(asof, 1), "Future",
"Past"
)

  • Matrix setup


- Rows: your entity (e.g., Customer/Product)
- Columns: Bucket (outer) → Date (inner)
- Values: SUM(Value)
- This gives grouped headers: Current | Next | Future, with the corresponding dates under each

Alternative (keep wide table, no unpivot)

  • Create three measures using an AsOf slicer:


- Current = CALCULATE([Value], 'Date'[Date] = Selected AsOf)
- Next = CALCULATE([Value], 'Date'[Date] = EDATE(Selected AsOf, 1))
- Future = CALCULATE([Value], 'Date'[Date] > EDATE(Selected AsOf, 1))

  • Use Field Parameters to place these measures as Matrix columns
  • For dynamic header text like “Current (dd-MMM-yy)”, use a Calculation Group (Tabular Editor) to set display names based on the AsOf date

Notes

  • Unpivoting is the most scalable and makes dynamic column groups trivial.
  • Define “Next/Future” to match your period logic (day/week/month); replace EDATE with DATEADD for weeks/days.


Thanks

Haish K 

If I resolve your issue. Kindly give kudos to this post and accept it as a solution so other can refer this.

cengizhanarslan
Super User
Super User

In native Power BI visuals, a Table can’t do grouped/merged headers like that. A Matrix can, but only if you model the data so the “header group” is a column hierarchy, not separate physical columns. But you can always make some manual touches to your UX design. Just disable auto-width of your column headers, then Insert some Shapes on the top of your matrix.

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
danextian
Super User
Super User

Hi @cheid 

 

Measures alone will not be enough as they will be broken down into whatever dimension added to  a matrix viz. For example, Net Points will appear in all of the period categories instead of next and future only.  Also given that you have the same second level headers for Next and Future, how do you identify which  ones belong to which period?

Also, please provide a workable sample data (not an image) and not just the expected result. Of course, the expected result should match the sample data.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
amitchandak
Super User
Super User

@cheid , with Calculation group you can get static-> Current Period, Past Period and Future period 

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.