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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MrAdrien
Frequent Visitor

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

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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]
)
)
) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
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...

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])

amitchandak
Super User
Super User

@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]
)
)
) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

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   

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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