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...
vivran22
5 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
_Divide
Cheers!
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
Anonymous
5 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