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...
Anonymous
5 years agoNot applicable
Hi vivran22 ,
Yes there are additional row. However, there are only attributes (abc & def) as denominator. The rows with attrib in (xyz,abc) should be divided by abc .All other rows are to be divided by def
Regards,
Manish
- vivran225 years agoCommunity Champion
Anonymous
You may try this as calculated column:
Percent = VAR _ABC = LOOKUPVALUE('Table'[Value],'Table'[attrib] , "abc") VAR _DEF = LOOKUPVALUE('Table'[Value],'Table'[attrib] , "def") VAR _CurrentAT = 'Table'[attrib] VAR _Divide = DIVIDE('Table'[Value],IF(_CurrentAT in {"abc","xyz"},_ABC,_DEF)) RETURN _DivideCheers!
Vivek
If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter- Anonymous5 years agoNot applicable
Hi Vivek,
When I am replicating the same in my issue, the fourth line gives me the following error 'Cannot find the name '[attrib]'
BR,
Manish Kumar