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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Shackwell
Helper III
Helper III

Percentage Difference between a filtered value

Hello once again.

 

I am currently working on a database involving departments and subdepartments. What I am trying to do is to have all departments branched out and would like to input the following measure. I want to be able to see the % of the subdepartment within the department. For example,

 

Whole costs are 100 units and Departament A represents 5 units. Additionally Department A has subdepartments and I would like to know the weight of such subdepartment regarding the Department A. Because right now what I am able to do is to see given percentage but from the sum of the  whole Departments,

Thank you for your time,

3 REPLIES 3
Shackwell
Helper III
Helper III

Thank you for the swift reply. I will try to implement it as soon as I can I just have a question regarding the "//". I'm not sure what that is. 

Hi again Shakwell

 

// are comments.  I recommend that add comments to measure to document them and assist your learning.

 

Please click thumbs up and accept as solution buttons. Thanks 

speedramps_0-1652219958808.png

 

 

speedramps
Super User
Super User

Create this measure

 

Unitpercent =


// get units for sub department
VAR mysubdepartmentunits = 

SUM(yourtable[units])

// get units for department

VAR mydepartmentunits = 

CALCULATE(
SUM(yourtable[units],

ALLEXCEPT[Department]
)


RETURN
DIVIDE(
mysubdepartmentunits , 
mydepartmentunits
)

 

Format unitpercent  as a %

 

Create a visual table with

Department, Subdepartment, units and unitpercent 

 

Please click thumbs up and accept as solution buttons. Thanks 😀

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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
Top Kudoed Authors