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
Micha_BI
New Member

Counting the results of CONCATENATEX

Hello dear community,

 

I'm still fairly new to Power Bi and would like to have a better understanding of the tool. Currently I have a problem that I can't count a concatenated text. All of my attempts to implement them with a DAX formula have failed.

Basically, I want the concatenation of the "Cat" column to be displayed and right next to it the number of times this text occurs.

In Excel, I would have taken this column and made the countif formula. But this doesn't work with DAX or I don't know how it can work.

 

I tested it like this only to count "Medi". But how can i count all concatenated text in column "Cat_Combi"?

 
Cat_Combi-Counter =
var Hilfstabelle = ADDCOLUMNS(DISTINCT(Tabelle11[Cat]),"Cat--Combi",[Cat_Combi])
return
COUNTROWS(FILTER(Hilfstabelle,[Cat--Combi]= "Medi"))

 

Micha_BI_0-1658907078715.png

 

Excel Countif like this:

Micha_BI_0-1658912727512.png

This are the correct results

 

 

I hope somebody can help me.

3 REPLIES 3
amitchandak
Super User
Super User

@Micha_BI , You can create a new column

 

column = countx(filter(Table, [Cat_combi] =  earlier( [Cat_combi]) ), [order_id])

 

or a new measure

measure = countx(filter(allselected(Table), [Cat_combi] =  max( [Cat_combi]) ), [order_id])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Micha_BI
New Member

Hello amitchandak,

 

thanks for your quick answer. But the solution didnt work, because "Cat_combi" is a measure.

 

Cat_Combi = CONCATENATEX(DISTINCT(Tabelle11[Cat]),Tabelle11[Cat]," - ")

 

Do you have any other idea ?

 

here the origin table:

 

Order_IDProductCat

100yellowMedi
100blueMedi
100greenMedi
200yellowMedi
200blueMedi
200greenMedi
300yellowMedi
300blueMedi
300greenMedi
222ViolettGlucose
223ViolettGlucose
224ViolettGlucose
225ViolettGlucose
225goldMedi
230yellowMedi
230blueMedi
230greenMedi
230redNative
230redNative

 

 

The solution in Excel is

  Countif($E$4:$E$11;E4)
100Medi3 
200Medi3 
222Glucose3 
223Glucose3 
224Glucose3 
225Medi -Glucose1 
230Medi -Native1 
300Medi3 

 

Anonymous
Not applicable

Hi @Micha_BI 

I don't understand why the count of 222 , 223 , 224 is 3 ? The measure [Cat_Combi-Counter] is count the value which contains "Medi" , but the value of 222 , 223 , 224 do not contain "Medi" . So the result is not a problem.

What is your calculation logic in excel?

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (27)