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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jlaroo33
Frequent Visitor

Dynamic Title with Time Hierarchy

Hello!

 

I am working on creating a dynamic title for a card that summarizes the total number of hires in a certain time period, based on where the user is drilled into a related bar graph. I found the following DAX that gets me close, but I'm not wanting to concantenate the results. For example, if they are drilled into 2022 > Quarter 1 > April, I want the header to read "April". Is this possible? Here's what I'm working with:

 

Selected Value =

SELECTEDVALUE('Date Table'[Date].[Year])&" "&

SELECTEDVALUE('Date Table'[Date].[Quarter])&" "&

SELECTEDVALUE('Date Table'[Date].[Month])&" "&

SELECTEDVALUE('Date Table'[Date].[Day])

 

Thank you! Jodi

1 ACCEPTED SOLUTION
jlaroo33
Frequent Visitor

@JirkaZ Thank you for the suggestion! I couldn't quite get that to work, but here is what I found in case others come across a similar issue. Please forgive my formatting, I'm new to DAX. 🙂

 

Selected Value =
IF(ISFILTERED('Date Table'[Date].[Month]),""& SELECTEDVALUE('Date Table'[Date].[Month])&" "&SELECTEDVALUE('Date Table'[Date].[Year],", "),
IF(ISFILTERED('Date Table'[Date].[Quarter]),""& SELECTEDVALUE('Date Table'[Date].[Quarter])&" "&SELECTEDVALUE('Date Table'[Date].[Year],", "),
IF(ISFILTERED('Date Table'[Date].[Year]),""& SELECTEDVALUE('Date Table'[Date].[Year],", "),"YTD")))

View solution in original post

2 REPLIES 2
jlaroo33
Frequent Visitor

@JirkaZ Thank you for the suggestion! I couldn't quite get that to work, but here is what I found in case others come across a similar issue. Please forgive my formatting, I'm new to DAX. 🙂

 

Selected Value =
IF(ISFILTERED('Date Table'[Date].[Month]),""& SELECTEDVALUE('Date Table'[Date].[Month])&" "&SELECTEDVALUE('Date Table'[Date].[Year],", "),
IF(ISFILTERED('Date Table'[Date].[Quarter]),""& SELECTEDVALUE('Date Table'[Date].[Quarter])&" "&SELECTEDVALUE('Date Table'[Date].[Year],", "),
IF(ISFILTERED('Date Table'[Date].[Year]),""& SELECTEDVALUE('Date Table'[Date].[Year],", "),"YTD")))
JirkaZ
Solution Specialist
Solution Specialist

I think you'll have to go backwards and check Day, Month, Quarter and Year with HASONEVALUE. 
I'd use SWITCH(TRUE(), ... ) for that.
The first value with one value selected should then be used as title.

 

I hope my logic is correct on this 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors