Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
EVG-Questions
Frequent Visitor

How to count row combinations based on common value

I'm trying to find the frequency of combinations that occur per an ID value. Example given here:

EVGQuestions_0-1653656523967.png

 

The problem is that the number of rows that could make up a combination is variable, meaning a combination could consist of just 1 value or 2, 3, 4, etc.

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @EVG-Questions ,

You could create a column as below:-

Column = CONCATENATEX(FILTER(ALL('Table (2)'),[ID]=EARLIER('Table (2)'[ID])),[Cat1],"")

Then create a measure as below:-

Measure = 
COUNTROWS (
    FILTER (
        VALUES ( 'Table (2)'[Id] ),
        CALCULATE ( COUNT ( 'Table (2)'[Column]) >= DISTINCTCOUNT ('Table (2)'[Column]) )
    )
)

Output:-

Samarth_18_0-1653658894141.png

Refer a attached file.

BR,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @EVG-Questions ,

You could create a column as below:-

Column = CONCATENATEX(FILTER(ALL('Table (2)'),[ID]=EARLIER('Table (2)'[ID])),[Cat1],"")

Then create a measure as below:-

Measure = 
COUNTROWS (
    FILTER (
        VALUES ( 'Table (2)'[Id] ),
        CALCULATE ( COUNT ( 'Table (2)'[Column]) >= DISTINCTCOUNT ('Table (2)'[Column]) )
    )
)

Output:-

Samarth_18_0-1653658894141.png

Refer a attached file.

BR,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Hi,

 

How can I get distinct value for the output? For example, A A B B = A B, A B B C C C = A B C.

I tried to add the distinct function but an error occured. "Too many arguments were passed to the DISTINCT function. The maximum argument count for the function is 1."

 

Thank you so much.

Anonymous
Not applicable

Hi,

 

I have this, but if the same CAT1 is more than one time fo an ID it is not listed.

 

Colonne = VAR IDNBR=Feuil25[ID]
var _step1=filter(SUMMARIZE(Feuil25,Feuil25[ID],Feuil25[Cat1]),Feuil25[ID]=IDNBR)
return
concatenatex(_step1,Feuil25[Cat1],"-")
JamesFr06_0-1653657432998.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.