Forum Discussion

Fasasi's avatar
Fasasi
Regular Visitor
6 years ago
Solved

Distinct count for column

I have a column that contain 2 distinct values, incoming and outgoing. How can I create a measure that will give me sum of each distinct. Like I want to have the total number of incoming and also total number of outgoing.
  • Thanks, I got what I need. I use :
    Count_incoming=calculate(counta(table[column]), table[column] in {'incoming'})

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

     

    That being said, you could put your column with incoming/outgoing in a visual and then just place your other column in the visual and use the default aggregation of sum.

     

    If you really want a measure, you could do something like:

    Measure Incoming = SUMX(FILTER('Table',[Column]="Incoming"),[Column1])
    Measure Outgoing = SUMX(FILTER('Table',[Column]="Outgoing"),[Column1])
  • Fasasi's avatar
    Fasasi
    Regular Visitor
    Thanks, I got what I need. I use :
    Count_incoming=calculate(counta(table[column]), table[column] in {'incoming'})