Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Invoice-lines

I'm new to PowerBI, so any help would be greatly appreciated! I have attached a table below as an example.   Invoice ID Invoice line ID Category Wanted 1 1 A A 1 2 B A 1 3 A ...
  • jdbuchanan71's avatar
    4 years ago

    Anonymous 

    You can add a calculated column to your table with this code.

    Wanted = 
    VAR _ACount = 
        CALCULATE(
            COUNTROWS('Table'),
            'Table'[Category]="A"
            ,ALLEXCEPT('Table','Table'[Invoice ID])
        )
    RETURN 
        IF ( _ACount > 0, "A", "Not A")