Forum Discussion
Dynamic Title Switcher
- 3 years ago
Hi JLarkin
Please tryTitle - Selection = CONCATENATEX ( VALUES ( DATE_DIM[MNTH_NAME] ), DATE_DIM[MNTH_NAME], " & ", CALCULATE ( MAX ( DATE_DIM[MNTH_NUMBER] ) ), ASC )Title = IF ( COUNTROWS ( VALUES ( 'DATE_DIM'[MNTH_NAME] ) ) = 3 && COUNTROWS ( VALUES ( 'DATE_DIM'[QTR] ) ) = 1, MAX ( 'DATE_DIM'[QTR] ), [Title - Selection] ) & " " & SELECTEDVALUE ( 'DATE_DIM'[YR_NBR] ) & " - Total Sales Bookings"
Hi,
Try This Dax Code Instead:
Title - Selection =
VAR __MonthOrder = LOOKUPVALUE(DATE_DIM[MNTH_NUMBER], DATE_DIM[MNTH_NAME], SELECTEDVALUE(DATE_DIM[MNTH_NAME]))
RETURN
CONCATENATEX(
VALUES(DATE_DIM[MNTH_NAME]),
DATE_DIM[MNTH_NAME],
" & ",
__MonthOrder,
ASC)
- JLarkin3 years agoFrequent Visitor
Hi ShahabHoghooghi,
Thank you for your response but this is unfortunately not what I need. The ASC does not take into account the sort column I have on the months, and then does it by alphabetical order. I also require for the title to switch to using the column [QTR_NBR] when 3 months in the same QTR are selected:
For example, selecting the first two months should display "January & February - Total Sales..", and selecting the first three should display "Q1 - Total Sales.."
Many thanks,
James
- ShahabHoghooghi3 years agoFrequent Visitor
No, If you have a look at the variable I defined, I used lookup value, then for example it lookup when the month name is March, then it gives you the month number column for that specefic selection, which is 3. It means that, this code will be sorted based on Month Number (numerical) not Month Name and will not be alphabetical.
The second concat measure you created is fine. you just need to change the first one and use month number for sorting instead of month name.
Hope it works for you.- JLarkin3 years agoFrequent Visitor
Hi ShahabHoghooghi.
The textbox is using the [Title - Selection] variable you defined, and it still displays as Feb & Mar & Jan, instead of Jan & Feb & Mar.