To divide the amount on the row, by the total for the row, you use the same DIVIDE function.

However, your second measure will need to use CALCULATE(Measure2, ALL(Table[Column]), where the Column is whatever you have on rows.

If I have sales laid out by department, with departments showing on each row, it would look like this:

Measure 1 = SUM(Sales[SalesAmount])

Measure 2 = CALCULATE(Measure1, ALL(Depts[DepartmentName]))

The first measure will respect the department context created by the rows, and give you the total sales for that department.

The second measure will ignore the department context created by the rows, filters and slicers, and give you the total sales for ALL departments.

There are several ALL functions available in DAX.

You can read about them here:

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept/Best,

Audrey

------------------------------

Audrey Abbey

SR. BI Developer/Analyst

New Seasons Market

Portland OR

------------------------------

Original Message:

Sent: 10-11-2018 10:12 AM

From: Don James

Subject: Excel Calculations in Power BI

Hi Audrey ,

Thanks for your reply.

What is the Dax formula to divide each line in the column to by the total , looking at the attached doc.

Any help will do

ThankS

DJ

------------------------------

Don James

77090

Houston TX

Original Message:

Sent: 10-10-2018 06:49 PM

From: Audrey Abbey

Subject: Excel Calculations in Power BI

In DAX, you can use the DIVIDE function:

DIVIDE(Measure1, Measure2)

The divide function will handle divide by zero errors natively, which is handy.

To multiply the result of the divide by 100:

DIVIDE(Measure1, Measure2) * 100

To format with negatives in brackets:

Currency format does this natively.

For other data types (like percentages) - you either have to have negatives show with a dash or concatenate the parenthesis yourself, which turns your number in to a string.

Things might get weird,especially with sorting.

------------------------------

Audrey Abbey

SR. BI Developer/Analyst

New Seasons Market

Portland OR

Original Message:

Sent: 10-10-2018 04:29 PM

From: Don James

Subject: Excel Calculations in Power BI

Hi All,

I have some calculation in excel sheet and l want to implement the same in Power BI.

I need your help with the Dax expression. Below is the logic. The attached doc has the example.

I need a Dax expression to calculate the % profit in the attached doc.

Also how to get the negative values in a bracket. ex -2569856 (2569856)

Any number in a bracket in the attached sheet is negative

Logic

To get the % Profit for each description.

Divide - Bikes/Product Line Profit * 100

17,507,002 / 105,216,979 *100 = 16.7%

Thanks

DJ

------------------------------

Don James

77090

Houston TX

8322005000

------------------------------