Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
i have customer ID and I have dates that repeat. i created a function that returns the 1st item in list and says, if item = item from list then null else 1... BUT, how do I use this on each set of Cust_ID? how do I loop each cust_id group and apply this logic?
please see screenshot, desired output is 3rd Col.
here is code to get 1st item in list and compare to dates. Just not sure how to loop each cust_id group to apply this to each cust-id thanks
= Table.AddColumn(#"Reordered Columns", "try_index", each if [Quarter Received_Date] = List.First( List.Distinct(#"Reordered Columns"[Quarter Received_Date])) then null else 1)
Solved! Go to Solution.
Group By first and then create the custom column in the grouped tables.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIyMDJUCDRUitWB840UAo3Q+MZgvhGavBFOeROl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [cust_id = _t, purchase_date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"cust_id", Int64.Type}, {"purchase_date", type text}}),
#"Grouped Rows" = Table.Group(
#"Changed Type",
{"cust_id"},
{
"index",
each Table.AddColumn(
_,
"index",
(x) => if x[purchase_date] = List.First( List.Distinct(_[purchase_date])) then null else 1)
}
)
in
#"Grouped Rows"
Group By first and then create the custom column in the grouped tables.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIyMDJUCDRUitWB840UAo3Q+MZgvhGavBFOeROl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [cust_id = _t, purchase_date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"cust_id", Int64.Type}, {"purchase_date", type text}}),
#"Grouped Rows" = Table.Group(
#"Changed Type",
{"cust_id"},
{
"index",
each Table.AddColumn(
_,
"index",
(x) => if x[purchase_date] = List.First( List.Distinct(_[purchase_date])) then null else 1)
}
)
in
#"Grouped Rows"
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |