Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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],
" & "
)
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
30 | |
15 | |
11 | |
10 | |
9 |