Created by Miki Yanagi, last modified on Jan 31, 2023
You can create a dynamic title using DAX.
Example: You want to show term description on the title based on selection on the slicer. Before using a dynamic title, the title on the table shows "Enrollment" only. This is a static title.
Steps:
Click the ellipsis next to name of the table (query) and click "new measure"
On the formula bar, write Table title = "Enrollment for " & SELECTEDVALUE( When you start writing the DAX, the pop-up window will automatically show up and let you choose the field.
In this case, term description from term table was chosen. After you pick the field, enter the close parenthesis at the end and then hit "enter".
Click the table (visual) and expand the "Title" on the Visualizations pane. Click the "fx" button.
Pick the field name you just created on step 3 under the "Based on field" dropdown and click "OK"
Now you will see the dynamic title. When you pick a different term, the title will change.
You can elaborate more on the dynamic title. Here are some examples:
The DAX set in the previous steps only works when only one value is selected. When multiple values are selected, the dynamic title will be blank. You can set the alternative value as follows:
Table title = "Enrollment for " & SELECTEDVALUE(Term[TERM_DESCRIPTION],"Multiple Terms")
You will see "Multiple Terms" on the tile when you select multiple terms now.
If you want to list all of the selected terms, you can set it up like this:
Table title =
"Enrollment for "
& IF (
ISFILTERED ( Term[TERM_DESCRIPTION] ),
CONCATENATEX (
FILTERS ( Term[TERM_DESCRIPTION] ),
Term[TERM_DESCRIPTION],
" & "
),
"all terms"
)
You will see this:
You can show "all terms," "multiple terms," or a single term, depending on your selection.
Table title =
"Enrollment for "
& IF (
NOT ISFILTERED ( Term[TERM_DESCRIPTION] ),
"all terms",
SELECTEDVALUE ( Term[TERM_DESCRIPTION], "multiple terms" )
)
Question, comment, critique? We are here to help and we strive to make our site a comprehensive, user friendly experience. Contact us at DARTS@maine.edu.