Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
When the titles are the same(1 and 2 same, 3 and 4 same), I wanna only get latest ReportedTime from each Titles.
Sometimes we have last minute changes so reporters adjust it and re-upload with the same file name, then I need only latest.
It's cumulative reports every week with Year & Week title,
They will be always 2 reporters so I cannot do descending order with leave top row.
Solved! Go to Solution.
Hi,
With UI, you can first Sort by 'ResponseTime' descending, Group by 'Title' with 'All Rows', then in your fx 'Table.Group' M code, use Table.FirstN(_, 1) to replace '_' after 'each'.
In Query editor, this is the entire UI generated code.
let
Source = table,
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Title", type text}, {"Response", type text}, {"ReportedTime", type datetime}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"ReportedTime", Order.Descending}}),
#"Grouped Rows" = Table.Group(
#"Sorted Rows",
{"Title"},
{
{"LatestRow", each Table.FirstN(_, 1), type table [Title=nullable text, Response=nullable text, ReportedTime=nullable datetime]}
}
),
#"Expanded LatestRow" = Table.ExpandTableColumn(#"Grouped Rows", "LatestRow", {"ReportedTime"}, {"ReportedTime"})
in
#"Expanded LatestRow"
Simplified & Optimized Solution
You can skip expanding and directly extract the fields you want:
let
Source = table,
#"Changed Type" = Table.TransformColumnTypes(Source, {{"Title", type text}, {"Response", type text}, {"ReportedTime", type datetime}}),
#"Grouped Rows" = Table.Group(
Source,
{"Title"},
{
{"LatestRow", each Table.Max(_, "ReportedTime"), type record}
}
),
#"Expanded LatestRow" = Table.ExpandRecordColumn(#"Grouped Rows", "LatestRow", {"Response", "ReportedTime"})
in
#"Expanded LatestRow"
Key Points:
Result:
You’ll get one row per Title, containing:
DAX version of this “latest record by group” logic
1-Latest ReportedTime by Title
This measure gives you the maximum ReportedTime for the current Title in a visual:
Latest ReportedTime =
CALCULATE (
MAX ( TableName[ReportedTime] ),
ALLEXCEPT ( TableName, TableName[Title] )
)
Use case:
2 - Latest Response by Title
If you also want the Response value from that latest row:
Latest Response =
VAR LatestDate =
CALCULATE (
MAX ( TableName[ReportedTime] ),
ALLEXCEPT ( TableName, TableName[Title] )
)
RETURN
CALCULATE (
MAX ( TableName[Response] ),
TableName[ReportedTime] = LatestDate
)
Use case:
3 - Virtual Table
If you want to create a table (not a measure), you can use:
Latest Records =
SUMMARIZECOLUMNS (
TableName[Title],
"Latest ReportedTime",
CALCULATE (
MAX ( TableName[ReportedTime] )
),
"Latest Response",
CALCULATE (
MAXX (
TOPN (
1,
TableName,
TableName[ReportedTime], DESC
),
TableName[Response]
)
)
)
Use case:
Your kudos is highly appreciated. If it helps you to solve your challenge, I would be happy if you accept it as a solution.
@Anonymous
is this what you want?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUXIsKCjKL0sFsowMjEz1DfUNFQwsrAwsrQyNlGJ1cKoxNLIyNLQyMgarSQLKBKVmpSaXIJQYK5hYGZlbmRrAVWCYAlZiYWUMVBILAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Title = _t, respone = _t, ReportedTime = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Title", type text}, {"respone", type text}, {"ReportedTime", type datetime}}),
SortedRows = Table.Sort(#"Changed Type" ,{{"Title", Order.Ascending}, {"ReportedTime", Order.Descending}}),
RemovedDuplicates = Table.Distinct(SortedRows, {"Title"})
in
RemovedDuplicates
pls see the attachment below
it this is not what you want, pls provide the expected output based on the sample data you provided
Proud to be a Super User!
Hi @Anonymous
Do these:
Hi @Anonymous
Do these:
@Anonymous
is this what you want?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUXIsKCjKL0sFsowMjEz1DfUNFQwsrAwsrQyNlGJ1cKoxNLIyNLQyMgarSQLKBKVmpSaXIJQYK5hYGZlbmRrAVWCYAlZiYWUMVBILAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Title = _t, respone = _t, ReportedTime = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Title", type text}, {"respone", type text}, {"ReportedTime", type datetime}}),
SortedRows = Table.Sort(#"Changed Type" ,{{"Title", Order.Ascending}, {"ReportedTime", Order.Descending}}),
RemovedDuplicates = Table.Distinct(SortedRows, {"Title"})
in
RemovedDuplicates
pls see the attachment below
it this is not what you want, pls provide the expected output based on the sample data you provided
Proud to be a Super User!
Simplified & Optimized Solution
You can skip expanding and directly extract the fields you want:
let
Source = table,
#"Changed Type" = Table.TransformColumnTypes(Source, {{"Title", type text}, {"Response", type text}, {"ReportedTime", type datetime}}),
#"Grouped Rows" = Table.Group(
Source,
{"Title"},
{
{"LatestRow", each Table.Max(_, "ReportedTime"), type record}
}
),
#"Expanded LatestRow" = Table.ExpandRecordColumn(#"Grouped Rows", "LatestRow", {"Response", "ReportedTime"})
in
#"Expanded LatestRow"
Key Points:
Result:
You’ll get one row per Title, containing:
DAX version of this “latest record by group” logic
1-Latest ReportedTime by Title
This measure gives you the maximum ReportedTime for the current Title in a visual:
Latest ReportedTime =
CALCULATE (
MAX ( TableName[ReportedTime] ),
ALLEXCEPT ( TableName, TableName[Title] )
)
Use case:
2 - Latest Response by Title
If you also want the Response value from that latest row:
Latest Response =
VAR LatestDate =
CALCULATE (
MAX ( TableName[ReportedTime] ),
ALLEXCEPT ( TableName, TableName[Title] )
)
RETURN
CALCULATE (
MAX ( TableName[Response] ),
TableName[ReportedTime] = LatestDate
)
Use case:
3 - Virtual Table
If you want to create a table (not a measure), you can use:
Latest Records =
SUMMARIZECOLUMNS (
TableName[Title],
"Latest ReportedTime",
CALCULATE (
MAX ( TableName[ReportedTime] )
),
"Latest Response",
CALCULATE (
MAXX (
TOPN (
1,
TableName,
TableName[ReportedTime], DESC
),
TableName[Response]
)
)
)
Use case:
Your kudos is highly appreciated. If it helps you to solve your challenge, I would be happy if you accept it as a solution.
Hi,
With UI, you can first Sort by 'ResponseTime' descending, Group by 'Title' with 'All Rows', then in your fx 'Table.Group' M code, use Table.FirstN(_, 1) to replace '_' after 'each'.
In Query editor, this is the entire UI generated code.
let
Source = table,
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Title", type text}, {"Response", type text}, {"ReportedTime", type datetime}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"ReportedTime", Order.Descending}}),
#"Grouped Rows" = Table.Group(
#"Sorted Rows",
{"Title"},
{
{"LatestRow", each Table.FirstN(_, 1), type table [Title=nullable text, Response=nullable text, ReportedTime=nullable datetime]}
}
),
#"Expanded LatestRow" = Table.ExpandTableColumn(#"Grouped Rows", "LatestRow", {"ReportedTime"}, {"ReportedTime"})
in
#"Expanded LatestRow"
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 50 | |
| 45 |