Forum Discussion

MrAdrien's avatar
MrAdrien
Frequent Visitor
3 years ago
Solved

Create a measure that return a string value from a column depending on selected value

Hi everybody,

 

First thank you helping me

 

I am trying to create a time of event that milestone.

This time line in filled in from Jira Issue

We want this timeline to be contextualize by personas, example manager, developer, testers

 

Each issue have within its description field the 3 TAGS

[manager] they will.....[/manager]

[developer]they get... [/developer]

[testers]....[/testers]

 

This description field of the issue table is split in 3 columns under PowerQuery using delimiters

So we have

'DescManager' column

'DescDeveloper' column

'DescTester' column

 

I have created a table called Personas with one column PType where there is 3 rows containing 3 different string values

Manager

Developer

Tester

 

I want that whenever a slicer filter on either of these 3 value the measureDescPersona return the value in the right column ('DescManager','DescDesveloper' or 'DescTester')

 

I am using a measure to do that

DescPersona =
IF(
    SELECTEDVALUE(Personas[PType]) ="Manager",
    'Issues New'[DescManager],
    IF(
        SELECTEDVALUE(Personas[PType]) ="Developer",
        'Issues New'[DescDeveloper],
        IF(
            SELECTEDVALUE(Personas[PType])="Tester",
            'Issues New'[DescTester],
             'Issues New'[Description]
        )
    )
)

 

The measure doesn't work and say it doesn't return an unique value

 

Can you please help me to correct this measure so the right description is return when I select either manager or developer or tester using the slicer (using the 'Persona'[Ptype]

 

Thank you again

  • MrAdrien , In measure you have use aggregation

     

    example

     

    DescPersona = maxx('Issues New',
    IF(
    SELECTEDVALUE(Personas[PType]) ="Manager",
    'Issues New'[DescManager],
    IF(
    SELECTEDVALUE(Personas[PType]) ="Developer",
    'Issues New'[DescDeveloper],
    IF(
    SELECTEDVALUE(Personas[PType])="Tester",
    'Issues New'[DescTester],
    'Issues New'[Description]
    )
    )
    ) )

5 Replies

  • MrAdrien , In measure you have use aggregation

     

    example

     

    DescPersona = maxx('Issues New',
    IF(
    SELECTEDVALUE(Personas[PType]) ="Manager",
    'Issues New'[DescManager],
    IF(
    SELECTEDVALUE(Personas[PType]) ="Developer",
    'Issues New'[DescDeveloper],
    IF(
    SELECTEDVALUE(Personas[PType])="Tester",
    'Issues New'[DescTester],
    'Issues New'[Description]
    )
    )
    ) )

    • MrAdrien's avatar
      MrAdrien
      Frequent Visitor

      Thank you for your quick answer.

      Good news  : measure is not in error

      Bad news : it return blank results

       

      Maybe to add information

      I have like 1000 issues in the table 'Issues New'

      Only 30 of them have manager, developer, tester description

       

      The graphic timeline display only issues with specific metadata filtered (Priority, country, etc...) from 'Issues New' table

      The graphic timeline is build by giving

      The title of the issue

      The due date of the issue

      The description of the which is here the measure we are trying to build

      • MrAdrien's avatar
        MrAdrien
        Frequent Visitor

        To give more insight the issue new table look like this

         

        Issue IDDescriptionDescManagerDescDeveloperDescTester
        1Info 1   
        2Info 2   
        3

        [manager] they will.....[/manager]

        [developer]they get... [/developer]

        [testers]....[/testers]

        They willthey get.........
        ...Info...   
        1000Info 1000   
  • MrAdrien's avatar
    MrAdrien
    Frequent Visitor

    I made a simple test with this code line

    MeasureDescPersona = MAXX('Issues New', 'Issues New'[Description])

     

    I put it in the field of the timeline graph, and nothing is displayed

     

    Of course it work when in the field I directly put 'Issues New'[Description])

  • MrAdrien's avatar
    MrAdrien
    Frequent Visitor

    I set it solved, using DAX Studio I found that the measure is correct, it is a problem of the graph itself : Timeline by Queryon.

    The description field doesn't accept measure but only column...