Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

CalculateTable as First Occurence from Table with Repeated Values

I've simplified this as much as possible to focus on my need.

 

Every day I identify a list of errors in our system and add the current day's errors to a list of errors from previous days.

 

So the data table has the following structure and content: 

 

   Date    Error
01/01/2019   A
01/01/2019   B
01/01/2019   C
01/02/2019   A
01/02/2019   B
01/01/2019   C
01/02/2019   D

01/03/2019   B
01/03/2019   D

01/03/2019   E

01/03/2019   F

 

I'm trying to use CalculateTable to create a table that has only one row for each error, and the date on that row should be the first date for the row in the table.

 

I would like the resulting table to look like this:

   Date    Error
01/01/2019   A
01/01/2019   B
01/01/2019   C
01/02/2019   D

01/03/2019   E

01/03/2019   F

 

Thanks!

  • Hi,

    Just in case you want to explore the Query Editor solution, you can use Group By and then select the function as Minimum.

4 Replies

  • Iamnvt's avatar
    Iamnvt
    Icon for Continued Contributor rankContinued Contributor

    Anonymous  I don' think CALCULATETABLE can do this operations.

     

    you can try SUMMARIZE:

    Summarize = SUMMARIZE('Table', 'Table'[Error], "Date", MIN('Table'[Date]))
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks! This is good to know if I need to summarize for a single column and don't need to use the results in a matrix. Unfortunately, I need to summarize for more than one column in the table and the results will be displayed in a matrix. I didn't demonstrate that in my details, so you wouldn't have known.

  • Hi,

    Just in case you want to explore the Query Editor solution, you can use Group By and then select the function as Minimum.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks!

       

      This is the right path for what I need. Now I need to figure out an effective way to include results from more than one table in a matrix.

       

      Cheers!