Forum Discussion
Grouping Columns
- 8 months ago
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
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.