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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

dividing row values with subtotal

i want to divide each row of TY_Actual with its subtotal i.e 110679.54 to get the %. i created 1 measure and it was showing correct value but the catch was the value was getting displayed in total row rest rows were empty

Screenshot 2023-11-06 165416.png    

1 ACCEPTED SOLUTION

Hi, @Anonymous 

sorry, in above code there are some changes needed and i forgot to write it 
try below code 

result = 

var a = sum('yourtablename'[TY_Actual])
var b = calculate ( sum('yourtablename'[TY_Actual],
                  removefilters('yourtablename')
                   )

return
divide(a,b)




 

if it not work then provide some sample data

View solution in original post

6 REPLIES 6
Dangar332
Super User
Super User

Hi, @Anonymous 

 

try below code 
just adjust your table and column name

 

result = 

var a = sum('yourtablename'[TY_Actual])
var b = calculate ( sum('yourtablename'[TY_Actual],
                  removefilters('yourtablename')
                   )
return
divide (a,b)

 

Anonymous
Not applicable

not working

 

Hi, @Anonymous 

sorry, in above code there are some changes needed and i forgot to write it 
try below code 

result = 

var a = sum('yourtablename'[TY_Actual])
var b = calculate ( sum('yourtablename'[TY_Actual],
                  removefilters('yourtablename')
                   )

return
divide(a,b)




 

if it not work then provide some sample data

Anonymous
Not applicable

Thank You so much....

VBLOT
Helper I
Helper I

Hello @Anonymous ,

 

Could you give more info on the measure you tried ?

 

In a first look, I could suggest in your measure to calculate the SUM of TY_Actual filtering by DayPart, and to calculate the same SUM but selecting all your table with ALL or ALLSELECTED depending on your need.

 

Then you can divide the filtered sum by the second and format your measure as %.

 

It could look like :

 

MyPercentage = 

VAR FilteredSum = CALCULATE (
SUM('YourTable'[TY_Actual], 
FILTER('YourTable', 'YourTable'[Daypart] = SELECTEDVALUE('YourTable'[Daypart])
)

VAR GlobalSum = SUM('YourTable'[TY_Actual])

RETURN DIVIDE(FilteredSum, GlobalSum)

 

Hope it helps

 

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

Anonymous
Not applicable

not working sir

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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