Forum Discussion

nuttybuddy's avatar
nuttybuddy
Frequent Visitor
8 years ago
Solved

Use WHERE condition in DAX

Hi guys

IN SAP Web intelligence, there is a WHERE function available just like SQL.

 

I want to reproduce the below formula in a calculated column in PBI as below  

Total Sales USA = [TotalSales] where ([Coutry] = 'USA'

 

 

Any help will be greatly appreciated

 

 

thanks

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion
    Total Sales USA = CALCULATE([TotalSales], [Coutry] = "USA")
  • Anonymous's avatar
    Anonymous
    Not applicable

    This doesn't work in PowerBI Desktop

    • k3rz0rg's avatar
      k3rz0rg
      Icon for Advocate III rankAdvocate III

      Yes, same with me, that solution does not work on PBD, not sure why that answer was selected as the right answer by the bot!