Forum Discussion
ravimankotia
3 years agoNew Member
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 -
| Regions | A | B | Penetration using formula =B/(A+B) |
| Africa | 56 | 112 | 66.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
- DOLEARY85Resident 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 👍 - DOLEARY85Resident 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 👍
- ShirinArshadniaHelper II
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] )RETURNA_Rates /( B_Rates + A_Rates )