Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

% Dax formular

Hi,

I am trying to work out what one number is as a percentage of another number.

For example, what is the totals of 1 column as a percentage of another column?

Column A totals up to 10
Column B totals up to 100

I ideally want to work out what percentage is column A out of column B so the answer will be 10 but how do I transfer this to Power Bi?


4 Replies

  • Anonymous , no very clear

     

    measure = divide(sum(Table[A]),sum(Table[B]))

  • Hi Serdet

     

    If you are new to Power BI then try start by using the Quick Measures.

    Simply clickon Modeling on the top menu and then click Quick Measure.

    the wizard is straight forward to follow and you will find Percent Difference under Mathmatical Operations.

    It is good way to learn DAX.

     

    Or try this ....

     

    Branch

    Product

    Quantity

    Spain

    Apples

    3

    Spain

    Oranges

    6

    Italy

    Apples

    8

    England

    Apples

    14

    England

    Pears

    5

    Germany

    Bananas

    18

    Germany

    Oranges

    6

     

    Create dax measures:-

     

    Total quantity = SUM(Sales[Quantity])

    Total apples = CALCULATE([Total quantity],Sales[Product]="Apples")

    Apple percentage = DIVIDE([Total apples],[Total quantity],0)

    Set Apple percentage format type to %

    Add a table visual with

    Branch, Total quantity, Total apples, Apple percentage

     

    Hope that helps!