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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Pbrit
Frequent Visitor

Get the Sum of distinct count

Dear Community Members,

 

I have a dax calculation that gets the count of students that were admitted 4 years ago.

My challenge is how to sum it, the result gives me the last value as the total instead of the sum of each row.

 

Please find my DAX query below:


Student Count Adm 4Yrs =
CALCULATE(
DISTINCTCOUNT(Admissions[AUGSTNO]),
DATEADD(DATESYTD(DimDate[Date]),-4,YEAR),
USERELATIONSHIP(Admissions[AUGSTNO],Graduation[GSTNO])
)

What I expect is the total to be the sum of the Student Count Adm 4yrs for each year.

Any direction to resolve this would be appreciated. 
Table showing the last value as the totalTable showing the last value as the total

1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @Pbrit try test measure below
Test =

 
SUMX(
VALUES(DimDate[Year]),
[Student Count Adm 4Yrs]
)

Did I answer your question? Kudos appreciated / accept solution!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

2 REPLIES 2
Pbrit
Frequent Visitor

@some_bih Thank You, 
This worked.

some_bih
Super User
Super User

Hi @Pbrit try test measure below
Test =

 
SUMX(
VALUES(DimDate[Year]),
[Student Count Adm 4Yrs]
)

Did I answer your question? Kudos appreciated / accept solution!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.