How it works...

Overall, the recipe for mode is relatively straightforward. We start by creating a table that uses the DAX SUMMARIZE function to group the rows in our data table by the column for which we are attempting to find the mode. In this case, the column is called Method. Within the same function, we create a column called __Count that stores the count of the original rows in the data table for each value in the column for which we are finding the mode. We store this table in a variable called __Table.

The next step is to simply filter our __Table to only contain the rows that have the highest number within the __Count column. This value, or values, of __Count is our mode. We store this filtered table in the __Table2 variable. We can finally calculate the __Mode variable and return either the single value using MAXX or, if there are ties, multiple values using CONCATENATEX.