Forum Discussion

KrishnaKawade's avatar
KrishnaKawade
New Member
1 year ago
Solved

Need M code for below Excel Query

Hi Community,   Will be a great help if someone will help on below Excel Query converting to M code. I tried multiple ways but getting Cyclic Reference error.  Need to get duplicates and show Yes...
  • v-priyankata's avatar
    1 year ago

    Hi KrishnaKawade 
    Thank you for reaching out to the Microsoft fabric community forum. thanks pankajnamekar25 for your inputs.
     
    I have reproduced your scenario in Power BI. Please find attached the .pbix file for your reference.


    If this post helps, then please give us ā€˜Kudos’ and consider "Accept it as a solution" to help the other members find it more quickly. 
     
    Thanks.

  • ryan_mayu's avatar
    1 year ago

    KrishnaKawade 

    you can try this 

     

    = Table.AddColumn(Source, "Custom", each if [Business Type] = "Tech" then "-" else if Table.RowCount(Table.SelectRows(Source,(x)=>x[SN]=[SN]))>1 then "Y" else "N")

     

     

    if this does not work, pls provide some sample data