Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Goal: I have a date slicer of date hierarchy (year, quarter, month). Based on user's selection, I need to create a dynamic title that captures all year, quarter, and month selected. Quarter(s) and month(s) follow after their respective year. For example, 2023 Q1 M1, 2 & 2024 Q2 M4. The title can get long but I will keep the question simple for now and worry about the length later.
Data Model: One fact table and one calendar table related by the [Date] column. Calendar table was generated from the [Date] column in the fact table. The calendar table has following 4 columns: [Date] - date type, [Year] & [Quarter] & [Month] - whole number type.
This question is about the date slicer selection. I will save the time by not involving the fact table here.
DAX I need help with:
Title =
Solved! Go to Solution.
Title =
VAR SelectedYears =
SUMMARIZECOLUMNS(
'Calendar'[Year],
'Calendar'[Quarter],
'Calendar'[Month]
)
RETURN
CONCATENATEX(
SelectedYears,
[Year] & " Q" & [Quarter] & " M" & [Month],
" & "
)
@lbendlin You are such a genius! Your DAX is simple and works wonder. I could have stopped here. But I added a few lines on top of your DAX to produce the right format for my situation - reduced the title length just a little bit.
Title =
VAR SelectedYears =
SUMMARIZECOLUMNS(
'Calendar'[Year],
'Calendar'[Quarter],
'Calendar'[Month]
)
RETURN
CONCATENATEX(
SelectedYears,
[Year] & " Q" & [Quarter] & " M" & [Month],
" & "
)