Forum Discussion

sabeensp's avatar
sabeensp
Helper IV
7 years ago
Solved

Sum IF Conditional

Hello, I have a masure (Sum of Transation), but transaction can be in multiple or one currency. I only want to sho wthe sum, if customer did a transaction in single currency.   pbix can be downl...
  • Greg_Deckler's avatar
    Greg_Deckler
    7 years ago

    Tough to say, that boundary case wasn't in the data. Should just have to modify the RETURN a bit:

     

    Measure = 
    VAR __table = SUMMARIZE(Table1,[Currency])
    VAR __count = COUNTROWS(__table)
    RETURN
    SWITCH(TRUE(),
      ISBLANK(__count),"No Data",
      __count = 1,SUM([Transaction Amount]),
      "Multiple Currencies"
    )