Forum Discussion

microsoftrookie's avatar
microsoftrookie
Icon for Advocate II rankAdvocate II
8 years ago
Solved

Dyanmic Title card help

Hello, I made a dynamic title card with the following switch function which should return a specific value based on what is selected, however the Title Card's measure does not seem to be working the ...
  • microsoftrookie's avatar
    microsoftrookie
    8 years ago

    Hello Anonymous,

    Xiaoxin,

    Thank you for all your help; however I have found a solution to my problem. The snippet of code for the measure I used was 

    Sample Measure =

    VAR Location =
    VALUES ( Sheet1[Location] )
    VAR sample3 = COUNTROWS ( Location )
    VAR NumberOfPossibleLocations =
    COUNTROWS ( ALL ( Sheet1[Location] ))
    VAR AllButLastSelectedLocation =
    TOPN ( NumberOfPossibleLocations - 1, Location )
    VAR LastSelectedLocation =
    EXCEPT (Location, AllButLastSelectedLocation)
    RETURN
    "Sample Text 1 Showing results for "
    & IF (
    sample3= NumberOfPossibleLocations,
    "sample text 2 ",
    "For "
    & IF (
    sample3 = 1,
    CONCATENATE(VALUES(Sheet1[Location])," This is determinate text and is used for one selection"),
    IF(
    sample3 =2,
    "Select Only one please my guy",
    IF(
    sample3 = 3,
    "Select Only one please my guy X3",
    IF(
    sample3 = 4,
    "Select Only one please my guy X4",
    IF(

    sample3 = 5,
    "Select Only one please my guy X5",
    "DEFAULT TEXT HERE PLEASE"
    )
    & LastSelectedLocation
    )))))

     

    Once again thank you for all your help, your insight was useful in making this information, although I did confirm that the measure did not accept a > sign in places where sample3 = 4 would be, this is also an acceptable solution.

    Regards,

    Microsoftrookie