0
votes

I am trying to do an If formula in Power bi, with filtering and comparing data. I want to check for every Client,who have with unique Transaction ID, if the Legal firm is the same. If its the same to return Yes, if not - NO.

**Client          | Transaction ID | Legal firm**
American Express  |2295876         |Orrick Herrington
American Express  |2295877         |Orrick Herrington
American Express  |2295878         |Orrick Herrington
Swedbank AB       |2287074         |Linklaters
Swedbank AB       |2287074         |Clifford Chance
Swedbank AB       |2287075         |Clifford Chance

I tried Calculate with distinct count, but it wasn't possible to include if statement.

1

1 Answers

0
votes

You should be able to do it with COUNT, and removing the filter context on the Legal Firm using ALLEXCEPT, for example

Measure = 
VAR rowCheck = CALCULATE(COUNT(Table1[Legal firm]), ALLEXCEPT(Table1, Table1[Transaction ID]))
VAR textValue = IF(rowCheck = 1, "Yes", "No")
RETURN
textValue

[My example[1]

Hope that helps