Remove rows based on ifelse statement in Dax

45 views Asked by At

I am trying to create a measure to prevent double counting. The dax code below works fine unless [LC or USD] = "USD". I need to remove the rows when [LC or USD] = "USD" holds. How to get around with this? Many thanks in advance.

`MyBase = SUM('MyData'[Amount])`


 MyCalculate = 
    CALCULATE(    
        [MyBase],
        KEEPFILTERS('MyData'[Currency] = "USD"),
        KEEPFILTERS('MyData'[Scenario] = "AOP")
    
        )

MyData

MyData
    LC or USD     Currency Amount
    LC               USD      1
    LC               USD      1
    LC               USD      1
    USD              USD      1
    USD              USD      1
    USD              USD      1
    LC               EUR      1

Expected Result

 MyData
        LC or USD     Currency Amount
        LC               USD      1
        LC               USD      1
        LC               USD      1
        LC               EUR      1
1

There are 1 answers

1
davidebacci On BEST ANSWER

Try this:

Measure = [MyBase](FILTER(MyData, MyData[LC or USD] <> "USD"))

enter image description here