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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Applicable88
Impactful Individual
Impactful Individual

How to sum and count the "name" part of a summarized function?

Hello,

 

Sorry, that I posted similiar question here, but I think there is a misunderstanding what I was looking for.
I tried several ways to get the return of a aggregation in a summarized table which created column is defined as  "name" of the summarize syntax.

So I get values for "name": 

summarize(Tabelle2,[Status],"Name",DISTINCTCOUNT(Tabelle2[Status]))

So how  to wrap this summarize function up into a sumx or countx to get the values I need?

If I use this: sumx(summarize(Tabelle2,[Status],"Name",DISTINCTCOUNT(Tabelle2[Status]))) it returns double the values, because DAX apparently has the total values in every row saved. 

 

If I make a new calculated table and then sum up like sum(name) it works totally fine. But how to put it into a measure, without creating an extra table?? 

Thank you in advanced.

Best. 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Applicable88 

var __table = summarize(Tabelle2,Tabelle2[Status],"Name",DISTINCTCOUNT(Tabelle2[Status]))
 return
Sumx (  __table, [Name] )

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@Applicable88 

var __table = summarize(Tabelle2,Tabelle2[Status],"Name",DISTINCTCOUNT(Tabelle2[Status]))
 return
Sumx (  __table, [Name] )

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Applicable88
Impactful Individual
Impactful Individual

Hi @Fowmy,

 

that bears another question:

Since that approach build a table as a variable, why a regular sum doesn't work and why need a x-aggregated sumx here?

Measure 16 =
var __table = summarize(Tabelle2,Tabelle2[Status],"Name",DISTINCTCOUNT(Tabelle2[Serialnumber]))
return
Sum('__table'[Name])
And the second question is why I get 20 when calculating like this?:
sumx(summarize(Tabelle2,[Status],"Name",DISTINCTCOUNT(Tabelle2[Status])))
 
Thats the sample table:
Applicable88_0-1623150976210.png

 

@Applicable88 

 

You need to use an iterative function to read and aggregate vale's off a virtual table. 

Sorry, I am not clear about the expected result based on your explanation. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
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!

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.

Top Solution Authors