Forum Discussion

ravimankotia's avatar
ravimankotia
New Member
3 years ago

percentage

I need help on how to show percentage from 2 colomns in the matrix chart at the power bi using power query or any other function. 

 

See below example from MS excel - 

 

RegionsABPenetration using formula =B/(A+B)
Africa5611266.69%

 

how to I achieve this in the Power BI as this A & B value is selected using the filters from large set of dataset. 

3 Replies

  • DOLEARY85's avatar
    DOLEARY85
    Resident Rockstar

    Hi,

     

    create a measure with DAX:

     

    Measure  = CALCULATE(SUM('Table'[B]))/(CALCULATE(sum('Table'[A]))+CALCULATE(SUM('Table'[B])))
     
    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

  • DOLEARY85's avatar
    DOLEARY85
    Resident Rockstar

    If you need it in power query a custom column with the below should work:

     

    [B]/([A]+[B])

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

  • @ravimankotia 

    you can use this measure in order to achieve this purpose :

     

    Measure Percentage =
    VAR A_Rates =
    SUM (Table[A] )
    VAR B_Rates =
    SUM (Table[B] )
    RETURN
    A_Rates /( B_Rates + A_Rates )