Forum Discussion
Remove Rows in Dataset based on most recent ID and email address
- 9 years ago
I think this calculated table might be getting close. Just replace my Table2 with the name of your table
Table 3 = SELECTCOLUMNS( FILTER( CROSSJOIN( SELECTCOLUMNS( SUMMARIZECOLUMNS( 'Table2'[Email], "MAX ID", MAX('Table2'[ID]) ), "MAX Email",[Email], "MAX ID",[MAX ID] ) , 'Table2' ), 'Table2'[Email]=[MAX Email] && Table2[ID] = [MAX ID] ), "ID",[ID], "Email" , [MAX Email] )
I think this calculated table might be getting close. Just replace my Table2 with the name of your table
Table 3 = SELECTCOLUMNS(
FILTER(
CROSSJOIN(
SELECTCOLUMNS(
SUMMARIZECOLUMNS(
'Table2'[Email],
"MAX ID",
MAX('Table2'[ID])
),
"MAX Email",[Email],
"MAX ID",[MAX ID]
) ,
'Table2'
),
'Table2'[Email]=[MAX Email] &&
Table2[ID] = [MAX ID]
),
"ID",[ID],
"Email" , [MAX Email]
)- Phil_Seamark9 years agoMicrosoft Employee
Or you could go the calculated column way and have a column that shows a 1 or 0 depending if the row is the latest.
Just add the following calcualted column and then you can filter on it in the Report, Page or Visual filters.
Is Latest = IF( CALCULATE( COUNTROWS('Table2'), FILTER( ALL(Table2), 'Table2'[ID] > EARLIER('Table2'[ID]) && 'Table2'[Email] = EARLIER('Table2'[Email]) ) )+0=0,1,0) - markpendlebury9 years agoFrequent Visitor
Phil_Seamark Thanks for this answer. I thought I might need to create this as a Table and this appears to work perfectly.
I did need to add my additional fields but that was pretty simple. Thanks
My original source table was 200,000 rows so I've had to restrict the incoming dataset (which is ok) as the refresh was timing out the Power BI Gateway but I think I've got that working now.
Thanks