Forum Discussion
Anonymous
5 years agoNot applicable
Percentage Calculation
Hi Power BI Community User, I need your input while calculating the percentage column which is unique requirement. The first two rows in the below screen shot is to be divided by 'value' of 'att...
jaideepnema
5 years agoSolution Sage
Hey Anonymous ,
You can create a flag that identifies the abc or def attribute which will be used to identify the denominator and then create a calculate column as shown below
PCT Calculation =
var abc=CALCULATE(SUM('Table'[value]),'Table'[attrib]="abc",ALL('Table'))
var def=CALCULATE(SUM('Table'[value]),'Table'[attrib]="def",ALL('Table'))
var calc=IF('Table'[ABC]=1,DIVIDE('Table'[value],abc,BLANK()),DIVIDE('Table'[value],def))
return calc
Please accept this as solution if this helps !! Appreciate a Kudos 😀