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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PrasadPatil
Regular Visitor

Row wise calculation

Hi Community..!!

please refer below sample data

Catergory    sales

A                     6

B                      4

C                      6

D                      4

Total                20     

 

I wanted to create a calculated column which includes logic like

=sale_value1(6) /total(20), sale_value2(4)/total(20), sale_value3(6)/total(20),sale_value4/total(20)

each sales row divide by grand total

Could anyone help me to do this calculation.

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@PrasadPatil ,

Create a Measure to calculate Total Sales:

TotalSales = CALCULATE( SUM( Sales1[Sales] ),
                       ALL( Sales1 ))  // Where "Sales1" is the name of your table

Then create a Calculated Column:

Sales_Percent = DIVIDE( [Sales], [TotalSales], 0 )

Use the column tools menu to format as percent or decimal, whichever your preference.

Trust this is what you are looking for.

Regards,

View solution in original post

2 REPLIES 2
rsbin
Super User
Super User

@PrasadPatil ,

Create a Measure to calculate Total Sales:

TotalSales = CALCULATE( SUM( Sales1[Sales] ),
                       ALL( Sales1 ))  // Where "Sales1" is the name of your table

Then create a Calculated Column:

Sales_Percent = DIVIDE( [Sales], [TotalSales], 0 )

Use the column tools menu to format as percent or decimal, whichever your preference.

Trust this is what you are looking for.

Regards,

Thanks for the Quick response @rsbin 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.