Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I have a table with metrics. I need to calculate value for the certain line (Percent of Profit) by certain formula, and for the all other values by another sum([Amount of USD]).
I have a formula:
if(Metrics = 'Percent of Profit', Sum ({<Metrics = {'Sales'}>}[Amount of USD])/Sum ({{<Metrics = {'Cost'}>}[Amount of USD])-1,
[Amount of USD]) but this formula is invalid.
Please help me with this task.
Try this
if(Metrics = 'Percent of Profit', Num(Sum(TOTAL {<Metrics = {'Sales'}>}[Amount of USD])/Sum(TOTAL {<Metrics = {'Cost'}>}[Amount of USD])-1, '#,##%'), Num([Amount of USD], '#,00'))
I don't have access to check. But, My assumption is
Sum(Aggr(if(Metrics = 'Percent of Profit', Sum ({<Metrics = {'Sales'}>}[Amount of USD])/Sum ({{<Metrics = {'Cost'}>}[Amount of USD])-1, [Amount of USD]), Metrics))
Like this?
It's not work
Try this
if(Metrics = 'Percent of Profit', Num(Sum(TOTAL {<Metrics = {'Sales'}>}[Amount of USD])/Sum(TOTAL {<Metrics = {'Cost'}>}[Amount of USD])-1, '#,##%'), Num([Amount of USD], '#,00'))