Forum Discussion

afrutos's avatar
afrutos
Resolver I
4 years ago
Solved

Conditional

  Hello everyone, I have a question that I can't solve. In this table I have a column with IdAuthor, and another that is Author Category. I need to calculate something like this: If the IdAuthor ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi afrutos ,

    You can create a calculated column as below, please find the details in the attachment.

    Category = 
    VAR _category =
        CONCATENATEX (
            FILTER (
                ALL ( 'Authors' ),
                'Authors'[IdAuthor] = EARLIER ( 'Authors'[IdAuthor] )
            ),
            [CategoryAuthor],
            ",",
            'Authors'[CategoryAuthor]
        )
    RETURN 
        IF (
            _category = "Director,Screenwriter,Writer ",
            "Director and Screenwriter",
            'Authors'[CategoryAuthor]
        )

    Best Regards