• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to get running duplicates count

b_raj_kumar

New Member
HI,

In excel, I wrote 2 formulas to find "Unique values" & "Running Duplicates Count". I want to write similar formulas on Power Query / Power Bi Columns (Expecting same excel results).

Any help would be much appreciated. Cheers!...


Regards
Raj Kumar
 

Attachments

  • sample.xlsx
    12.3 KB · Views: 5
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Category Number"}, {{"Data", each _, type table [Category Number=number]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Data],"Unique",1,1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Data"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Unique"}, {"Unique"})
in
    #"Expanded Custom"
 
Back
Top