title: SQL select & group-by as DAX
body: <p>I am trying to create a new measure in power BI from my database - i have a table from which i can run a query and get a csv file of the result but want to set the report up to look at up to date data and the csv is only a snapshot.
  I count the individual row entries (error occurrences) to create a count of the errors and wish to group these by date (RTO_UPDATED) and location (RTO_BLOCK) for analysis on when and where we are experiencing these errors</p>
  <p>This is the code below:</p>
  <pre><code>select count(*) as Errors,
          cast(RTO_UPDATED as date) as Date,
          RTO_BLOCK
   FROM [MIS_Apps].[dbo].[LiveRTOLocationErrorsHistorical]
    group by cast(RTO_UPDATED as date),
          RTO_BLOCK
  </code></pre>
  <p>If someone could help me convert this to DAX it would be greatly appreciated</p>
  <p>I have tried this (below) but apparently the evaluate syntax is incorrect and i am unsure how to change it when a group-by is involved?</p>
  <pre><code>  EVALUATE SELECTCOLUMNS( 
      count(*) as Errors, cast(RTO_UPDATED as date) as Date, RTO_BLOCK 
      FROM [MIS_Apps].[dbo].[LiveRTOLocationErrorsHistorical] 
      group by cast(RTO_UPDATED as date), RTO_BLOCK 
      )
  </code></pre>