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

Dax calculation help

Hello, 

 

I need somehelp on Dax calulation. Below is the sample data:

 

I have dataset like below. 

DepartmentGradeNo of Emp
ITA90
ITB90
ITC90
HRA10
HRB5
HRC1
NonITA4
NonITB16
NonITC0
SecurityA5
SecurityB3
SecurityC2

 

Required output is below:

DepartmentNo of Emp
IT90
HR16
NonIT20
Security10

 

Only for 'IT' department i dont want to do the sum of 'No of Emp' column but for all other departments I want to do the sum on 'No of Emp' and display the value. As you can see for IT the value is same 90 in source dataset and output table but for HR in the output table it is 20 (10+5+1). 

 

Can someone please advice how I can get this. Please let me know if I am not clear.

Thank you.

1 ACCEPTED SOLUTION

@Anonymous  In that case, create a new measure as below

 

Test288 = 
VAR _IT = MAXX(FILTER(Test288SumIF,Test288SumIF[Department]="IT"),Test288SumIF[NoOfEmp])
VAR _Other = SUMX(Test288SumIF,Test288SumIF[NoOfEmp])
RETURN IF(SELECTEDVALUE(Test288SumIF[Department])="IT",_IT,_Other)

image.pngimage.pngimage.png





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

Proud to be a PBI Community Champion




View solution in original post

4 REPLIES 4
PattemManohar
Community Champion
Community Champion

@Anonymous  Please try this as a New Table.

 

Test288Out = SUMMARIZE(Test288SumIF,Test288SumIF[Department],"Count",IF(Test288SumIF[Department]="IT",MAX(Test288SumIF[NoOfEmp]),SUM(Test288SumIF[NoOfEmp])))

image.png





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

Proud to be a PBI Community Champion




Anonymous
Not applicable

Hi @PattemManohar ,

 

Thank you its working but the other thing I would like to add is I want to show 'Department' and 'Grade' as slicers. So when the user select Department = IT and Grade = All then it should show 90 and even if the user select a particular grade lets say 'A' and department = IT it should show 90 only. Any chance its possible please? 

 

Many Thanks

@Anonymous  In that case, create a new measure as below

 

Test288 = 
VAR _IT = MAXX(FILTER(Test288SumIF,Test288SumIF[Department]="IT"),Test288SumIF[NoOfEmp])
VAR _Other = SUMX(Test288SumIF,Test288SumIF[NoOfEmp])
RETURN IF(SELECTEDVALUE(Test288SumIF[Department])="IT",_IT,_Other)

image.pngimage.pngimage.png





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

Proud to be a PBI Community Champion




Anonymous
Not applicable

Thanks alot @PattemManohar . Its working perfectly.

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