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
Anonymous
Not applicable

Sum of values in column from measure

I've seen feedback on this issue elsewhere but haven't as yet been able to apply any fixes to my own measure.

 

I have the following measure for which I want the total to show the sum of the rows in the table rather than applying the measure to the total:

 

Count of Applications = 

VAR CurrentYear = [CurrentYearOfEntry] - 2

RETURN
CALCULATE(
DISTINCTCOUNT(
CourseApplication[StudentCode]),
CourseApplication[Flag] = "1",
CurrentYear = CourseApplication[YearOfEntry],
CourseApplication[Group] = "Cohort1"
)
 
Currently this gives the result of:
CourseNameCount of Applications
Engineering18
Engineering21
Engineering32
Engineering42
Total12

 

I would need the total column to be the sum of the rows, so be 13 rather than 12 - how can amend my measure to allow for this?

 

Thanks for any help!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try like

 

Count of Applications = 

VAR CurrentYear = [CurrentYearOfEntry] - 2
RETURN
Sumx(Values(CourseApplication [CourseName]) CALCULATE(
DISTINCTCOUNT(
CourseApplication[StudentCode]),filter(CourseApplication,
CourseApplication[Flag] = "1",
CurrentYear = CourseApplication[YearOfEntry],
CourseApplication[Group] = "Cohort1"
)))

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , try like

 

Count of Applications = 

VAR CurrentYear = [CurrentYearOfEntry] - 2
RETURN
Sumx(Values(CourseApplication [CourseName]) CALCULATE(
DISTINCTCOUNT(
CourseApplication[StudentCode]),filter(CourseApplication,
CourseApplication[Flag] = "1",
CurrentYear = CourseApplication[YearOfEntry],
CourseApplication[Group] = "Cohort1"
)))

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
Anonymous
Not applicable

Thanks @amitchandak that works great.  I had just come up with the following solution which also worked:

Count of Applications = 

VAR CurrentYear = [CurrentYearOfEntry] - 2
RETURN
IF( ISFILTERED ( CourseApplication [CourseMode]),

Sumx(CourseApplication, CALCULATE(
DISTINCTCOUNT(
CourseApplication[StudentCode]),filter(CourseApplication,
CourseApplication[Flag] = "1",
CurrentYear = CourseApplication[YearOfEntry],
CourseApplication[Group] = "Cohort1"
)))

 

But your solution seems much neater and works just as well.

 

Thanks so much!

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