Forum Discussion

nchamilton2's avatar
nchamilton2
Frequent Visitor
1 year ago
Solved

Handling blanks

How do I return "Unassigned" in my table visual when the User doesn't exist? See example below. Ultimately I want to do some counts of projects by user and show how many are unassigned in a table. I...
  • MattiaFratello's avatar
    1 year ago

    Hi nchamilton2 ,

    Please create the following measure:

    Project Name =
    VAR AssignedName =
    LOOKUPVALUE(
    Table1[Name],
    Table1[UserId],
    SELECTEDVALUE(Table2[UserId])
    )
    RETURN
    IF(
    ISBLANK(AssignedName),
    "Unassigned",
    AssignedName
    )

    Add the Project Name measure and ProjectId from Table2 to your table visual.

    This measure will return the actual name if it exists or "Unassigned" if there’s no match.

    Expected Output

    Name ProjectId
    Jim123
    Bob456
    Mike789
    Unassigned987
  • techies's avatar
    1 year ago

    Hi nchamilton2 create a calculated column in table 2

     

    DisplayName =
    VAR User= LOOKUPVALUE(table1[Name], table1[UserID], table2[userid])
    RETURN IF(ISBLANK(User), "Unassigned", User)