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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Pick Department on the Bases of Student Selection From dropdown and Sum over All fee submitted

Hello Community,
I have a scenario that to Pick Department on the Bases of Student Selection From dropdown and Sum over All fee submitted for that department.

Detail
1: I have a student dropdown. (User can select 1 or more then 1 at a same time)
2: I need to pick the Department of the selected Student/Students (For Example IT, Commerace, Law etc)
3: I have to calculate the total Fee submitted for thta department. (will not consider the student but the department of that student)

I need something like this

Fee Submitted = 

VAR SelectedStudent =
    SELECTEDVALUE('Student'[Name])

VAR AssociatedDEPT =
    CALCULATE(
        VALUES('Student'[Department]),
        'Student'[Name] IN SelectedStudent
    )
RETURN
    CALCULATE(
        SUM('Student'[FeeSubmitted]),
        'Student'[Department] IN AssociatedDEPT

Your quick response will he highly appriciated
8 REPLIES 8
tamerj1
Super User
Super User

@Anonymous 
This shall also provide the same result

Fee Submitted =
CALCULATE (
    SUM ( 'Student'[FeeSubmitted] ),
    ALL ( 'Student'[Name] ),
    VALUES ( 'Student'[Department] )
)
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Fee Submitted =
SUMX (
    VALUES ( 'Student'[Department] ),
    CALCULATE (
        SUM ( 'Student'[FeeSubmitted] ),
        ALL ( 'Student'[Name] )
    )
)
Anonymous
Not applicable

For Example there is a student and not submitted the fee, If I am selecting such student the table gets empty.

because I only need his Department and against that department need to sum all the fee. and need to ignore Student filter.

@Anonymous 
I hope you have tried the code. What results have you obtained? How does your visual look like?

Anonymous
Not applicable

I tried the code you provided but when I am selecting any Student who did not submitted the Fee the table visual display Empty.
While I am expecting Total fee submitted for the department Associated with that Student

@Anonymous 
Agian, kindly requesting to provide a screenshot of the visual to better understand the problem.

Mahesh0016
Super User
Super User

@Anonymous 
please Share your Data modeling of Table for batter understanding!! Thank You!!

 

Anonymous
Not applicable

I have only 1 table "Student"
and I appended all others tables in this Student table.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.