Forum Discussion

ShivGC's avatar
ShivGC
Helper I
2 years ago

Simple Custom Data Label

HI,

I want to create a custom data label with Dax, where it refers to multiple different things.

For instance, I have an unrelated table 1 and table 2. 

In Table 1, there is one column with client names.

Client 

Client 1 
Client 2
Client 3


In Table 2, there are multiple columns but we only want to refer to the client identifier.

Client NameIdentifierValue
Client 1 Client 1 UK

10

Client 2 Client 2 USA20
Client 2Client 2 EUR30
Client 3Client 3 UK40



The result I would like to achieve in a measure is, 

If(
Selectevalue(Table 1[Client]) = Selectedvalue(Table 2[Client Name]),
Table 2[Identifier]&"-"&Table 2[Value]
)

My problem: I can not seem to reference table 2 as in the bolded part. Could some explain why and provide a solution?


2 Replies

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi,

    Similarly to your if condition use a function like SELEDTEDVALUE or MAX and you can see the result. 

    E.g.

    Measure_ = If(
    Selectedvalue('Table (3)'[Client ]) = Selectedvalue('Table (4)'[Client Name]),
    max('Table (4)'[Identifier])&"-"&MAX('Table (4)'[Value])
    )

     

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/

    • ShivGC's avatar
      ShivGC
      Helper I

      No sorry this does not work. 

      Why do you use a max function, when the identifier column is a string?