How to display a calculated field only on one specific row in a table visual

Hello,

I need to display a value only for one specific row, but I cannot find any function that allows me to do this. Could someone please help me?

In my dataset I have these two dimensions (nomeplanocontaspai02[dimplanocontasgerencial] and ordenacaodre[dimplanocontas]). The other columns in the screenshot are numeric fields.

  • The field _soma_lucro_bruto sums when descrplanocontaspai02[dimplanocontasgerencial] = ‘(=) Lucro Bruto’:

sum(
ifelse({descrplanocontaspai02[dimplanocontasgerencial]} = ‘(=) Lucro Bruto’, valorbaixaparcelaporplanocontas, 0)
)

  • The field _soma_receita_liquida sums when descrplanocontaspai02[dimplanocontasgerencial] = ‘(=) Receita Liquida’

sum(
ifelse({descrplanocontaspai02[dimplanocontasgerencial]} = ‘(=) Receita Liquida’, valorbaixaparcelaporplanocontas, 0)
)

  • After that I use sumOver to calculate the percentage of lucro bruto over receita liquida:

sumOver(
{_soma_lucro_bruto}
)
/
sumOver(
{_soma_receita_liquida}
) * 100

The result is correct, it is the value shown in the last column (highlighted in blue in the screenshot). The issue is that I need this result to appear only when the dimension descrplanocontaspai02[dimplanocontasgerencial] = ‘% sobre receita líquida’ (highlighted in red).

Right now, the _porcentagem field is shown for all rows. I would like this field to display the result only for that specific row in the table.

Thank you in advance.

Hi @DeividO,
What if you wrapped it in an ifelse statement that essentially says if field value equals ‘% sobre receita líquida’, run the calculation:

Yes, I considered putting it inside an ifelse statement, but I am not able to make it work. The error says:

Incompatible aggregation. Custom aggregations cannot contain aggregated and non aggregated fields in any combination.

Hi @DeividO,

Following up here as it’s been a while since last communication took place on this thread; did you have any additional questions regarding your initial post?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you

Hi @DeividO ,

As I haven’t received any additional information, I’ll treat this inquiry as complete at this time. Please feel free to create a new post if you have more questions.

Thank you