Forum Discussion
Convert Dax to M Code
I am trying to convert this DAX to M Code. I created a custom column with this DAX in the table view but I want to create this column in the Power Query editor. Please help!
Hello! This issue was resolved. I ended up being able to work it out with a simple index column. Thank you all so much!
7 Replies
- jgeddesSuper User
Consider example data...
You can get this result with the following code...
= Table.AddColumn(YourPreviousStep, "Unique Product", each let ranking = Table.RowCount(Table.SelectRows(YourPreviousStep, (r)=> [Product Name] = r[Product Name] and [Index] <= r[Index])) in if ranking > 1 then [Product Name] & " " & Number.ToText(ranking) else [Product Name], type text)This should get you pointed in the right direction.
- saddlerkaylaRegular Visitor
Thank you!
- AnonymousNot applicable
Hi saddlerkayla ,
Thanks for reaching out to the Microsoft fabric community forum. Thank you jgeddes for your helpful response.
Could you please confirm if your issue got resolved? For any further discussions or questions, please reach out to fabric community forum.
Thank you.
- AnonymousNot applicable
Hi saddlerkayla ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
- AnonymousNot applicable
Hi saddlerkayla ,
We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.Thank you.
- saddlerkaylaRegular Visitor
Hello! This issue was resolved. I ended up being able to work it out with a simple index column. Thank you all so much!
- Ashish_MathurSuper User
Hi,
Share some data to work with, explain the question and show the expected result.