Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How Group by function works in DAX?

Hi Folks, My requirement is I want to display the total sales happed in Bangalore and Chennai in new column. Instead of showing all the location  e.g  Location      Sales Bangalore  1000 Chennai...
  • amitchandak's avatar
    3 years ago

    Anonymous , Ideally you should use a measure

     

    calculate(sum(Table[Sales]), filter(Table, Table[Location] in {"Bangalore","Chennai"} ))

     

    or new column

     

    calculate(sum(Table[Sales]), filter(Table, Table[Location] in {"Bangalore","Chennai"} ))