Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Count Based on Group

Dear All,      I have a data like this, Sample File is attached for your ref:  Sample PBIX       In this what I have already calculated is --> "The Maximum Sales". Referring to the above ...
  • yelsherif's avatar
    7 years ago

    Here is a measure to solve your problem

     
    Split =
    var summaryTable = summarize(Table1,Table1[Sales],"count", count(Table1[ID]))
    var salesName = FIRSTNONBLANK(SELECTCOLUMNS(filter(summaryTable,maxx(summaryTable,[count])),"Sales",[Sales]),true)
    var theSplit = filter(summarize(Table1,Table1[Sales],Table1[Reason],"count", count(Table1[ID])),Table1[Sales]=salesName)
    return
    concatenatex(theSplit, [count] & " " & [Reason], ", ")