Forum Discussion

LearningBI1986's avatar
LearningBI1986
Frequent Visitor
3 years ago
Solved

Counting multiple values in a single column

Hi there I am learning BI. Right now, for simplistic reasons, I have a column of postal codes. I would like to count how many postal codes begin with "A," how many begin with "B," how many begin w...
  • Greg_Deckler's avatar
    3 years ago

    LearningBI1986 Perhaps create a DAX measure like this?

    Bubble Size Measure =
      VAR __PC = MAX('Table'[PostalCode])
      VAR __FirstChar = LEFT(__PC, 1)
      VAR __Table = FILTER(ALL('Table'), LEFT([PostalCode], 1) = __FirstChar)
      VAR __Result = COUNTROWS(__Table)
    RETURN
      __Result