Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

ConcatenateX with text and counts

Hello all, 

 

I have a need to create a Concatenated list with Counts and Values.   I can get the unique values through ConcatenateX, but I want to add the count of the number of times they appear.

 

My column is like this

 

Status

Pending
Pending
Pending
Live
Live

 

Im trying to write a measure to get a card that says " 3 Pending, 2 Live".   i can get to "Pending, Live" with this

CONCATENATEX(DISTINCT('Table'[Status]),'Table'[Status],", ")
 
But if I try to add any kind of count of the rows, I get "5 Pending, 5 Live"
 
Any ideas?
 

 

  • Try this:

     

    Measure = 
        VAR __Table = 
            SUMMARIZE(
                'Table',
                [Status],
                "Count",COUNTROWS('Table')
            )
    RETURN
        CONCATENATEX(__Table,[Count] & " " & [Status],", ")

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Try this:

     

    Measure = 
        VAR __Table = 
            SUMMARIZE(
                'Table',
                [Status],
                "Count",COUNTROWS('Table')
            )
    RETURN
        CONCATENATEX(__Table,[Count] & " " & [Status],", ")
    • Anonymous's avatar
      Anonymous
      Not applicable

      Brilliant!  Thank you!