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
I_LOVE_POWER_BI
Helper III
Helper III

Add Column with percentage based on column attributes in the same table

Hi friends,

 

Simple question, I just don't know the correct DAX:

 

I_LOVE_POWER_BI_0-1622529441903.png

I have a table like the one above and want to ADD COLUMN which shows the result as above. The column shall calculate the percentage based on the attributes in the column Receipe.

 

Help! Thanks a thousand times!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @I_LOVE_POWER_BI 

Please check the below.

 

Picture3.png

 

In Percentage CC =
'Table'[Weight]
/ CALCULATE ( SUM ( 'Table'[Weight] ), ALLEXCEPT ( 'Table', 'Table'[Receipe] ) )
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
jaideepnema
Solution Sage
Solution Sage

Hi @I_LOVE_POWER_BI ,

You can create a calculated column 

In % = 

var total=CALCULATE(SUM(Data[Weight]),ALLEXCEPT(Data,Data[Receipe]))

return DIVIDE(Data[Weight],total,0)

 

And create a matrix like this

jaideepnema_0-1622531574695.png

 

In case you want to use two columns and create a table then you can use calculated columns as shown below:

In % = 

var total=CALCULATE(SUM(Data[Weight]),ALLEXCEPT(Data,Data[Receipe]))

return DIVIDE(Data[Weight],total,0)
Total % = CALCULATE(SUM(Data[In %]),ALLEXCEPT(Data,Data[Receipe]))

and then create a table to get the desired result

jaideepnema_1-1622531709812.png

 

Hope this helps !!

 

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Jihwan_Kim
Super User
Super User

Hi, @I_LOVE_POWER_BI 

Please check the below.

 

Picture3.png

 

In Percentage CC =
'Table'[Weight]
/ CALCULATE ( SUM ( 'Table'[Weight] ), ALLEXCEPT ( 'Table', 'Table'[Receipe] ) )
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thanks Jihwan, it works! I did the same but I used ALL instead of ALLEXCEPT and got an error. Can you help me to understand what is the difference here?

 

Thanks!

Hi, @I_LOVE_POWER_BI 

Thank you for your feedback.

In my opinion, the All function clears all filters in the table. Allexcept function clears all filters except a certain column. In this case, the certain column is, I think, the Recipe column, and this column has to filter the formula.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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