Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JimKingPowerBI
Advocate II
Advocate II

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!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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!

Iamnvt
Continued Contributor
Continued Contributor

@JimKingPowerBI  I don' think CALCULATETABLE can do this operations.

 

you can try SUMMARIZE:

Summarize = SUMMARIZE('Table', 'Table'[Error], "Date", MIN('Table'[Date]))

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.