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

Divide elements of a column by the sum of another column while keeping filters on

Hi all,

 

I'm new to PoweBI and I'm looking for a way to divide the elements of a column by the total of another column while keeping filters on.

 

So for example:

A

B

date

12

87

9.16

16

32

9.16

56

35

9.17

 

What I want is the elements of A in date 9.16 divide by the sum of B in date 9.16, so:

A/B

date

12/(87+32)

9.16

16/(87+32)

9.16

 

I tried doing this in PowerBI

 

% AB= DIVIDE(SUM(table[A]),SUM(table[B]))

 

But it would give me

A/B

12/87

16/32

Which is not desired.

 

Futhermore I need to keep the date filter in, so I don't think ALL() would be approporiate.

 

Any kind of help would be highly appreciated!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 I created a measure to plement it with the function of ALLSELECTED.  The table still can be filtered by date.

Divide = DIVIDE(SUM('Table'[A]),CALCULATE(SUM('Table'[B]),FILTER(ALLSELECTED('Table'),'Table'[date] = MAX('Table'[date]))))

2.PNG3.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Please refer

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, thanks for your reply.  However, I'm trying to use the measure in different visuals and there will be different filter based on each individual visual so I don't think this solution applies.

Hi @Anonymous ,

 I created a measure to plement it with the function of ALLSELECTED.  The table still can be filtered by date.

Divide = DIVIDE(SUM('Table'[A]),CALCULATE(SUM('Table'[B]),FILTER(ALLSELECTED('Table'),'Table'[date] = MAX('Table'[date]))))

2.PNG3.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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