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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi, I'm a rookie at M and need help!
I'm preparing data for process mining and unfortunatley the process use the same status "14 - Approved" multiple times per ID. If possible, it would be great if I somehow could rename the second use of the status per ID to "14 - ODD Approved".
I've tried this M-formula to create a count of status 14 and based on the occurance rename the second one.
let
Source = Excel.CurrentWorkbook [Content],
Custom = Table.Group(Source, {"Efecte ID", "[StatusHistoryRefined;14KYCApproved]"}, {{"Count", each Table.RowCount(_), type number}}),
AddedCustom = Table.AddColumn(Custom, "New Status", each if [Count] > 1 and [Count] = 2 then "14 - ODD KYC Approved" else [StatusHistoryRefined;14KYCApproved]),
RemovedColumns = Table.RemoveColumns(AddedCustom, {"Count", "[StatusHistoryRefined;14KYCApproved]"}),
ExpandCustom = Table.ExpandTableColumn(RemovedColumns, "New Status", {"Efecte ID", "New Status"})
in
ExpandCustom
But it won't recognize [StatusHistoryRefined;14KYCApproved] as identifier.
Is it possible to solve my problem?
Solved! Go to Solution.
Hi @Roodakker
1.You can consider to add an index column group by each id first , the step can refer to the following link.
Create Row Number for Each Group in Power BI using Power Query - RADACAD
2.Then add a custom column
e.g(Then [Index] column is the one you have created above.
if [Index]=2 then "14 - ODD KYC Approved" else [StatusHistoryRefined;14KYCApproved]
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Roodakker
1.You can consider to add an index column group by each id first , the step can refer to the following link.
Create Row Number for Each Group in Power BI using Power Query - RADACAD
2.Then add a custom column
e.g(Then [Index] column is the one you have created above.
if [Index]=2 then "14 - ODD KYC Approved" else [StatusHistoryRefined;14KYCApproved]
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
the second use of the status
M has no idea what you mean by that. You need to introduce an index column.
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.