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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rana_Rumeel
Helper I
Helper I

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

@Rana_Rumeel 
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 @Rana_Rumeel 
Please try

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

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.

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

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

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

Mahesh0016
Super User
Super User

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

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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