Calculation with date filter and Ids, Power BI

Asked

Viewed 433 times

-1

Good morning,

I need to create a measure that makes the following calculation:

(Line value)/(Initial value)

However the calculation should be done respecting the ID (not divided by values of other Ids, and the base should be dynamic with the date filter).

Below the table format I have (all data are columns in the database).

As an example, the first values of ID 9 should be: (3,21/3,21) = 1; (3,24/3,21) = 1,009.

I created several measures but did not succeed in the execution of the task.

Thanks in advance.

inserir a descrição da imagem aqui

3 answers

0

Try to use the DIVIDE(Tabela['coluna'];Tabela['coluna2']), so it makes the division respecting the Ids. Then change the amount of decimals.

  • Good morning, it’s just that in this case I need to divide the bottom value by the top, so it wouldn’t work. Thank you

  • got it, I’ll take a look here to see how and q does it. I remember q in excel has like

0

I believe that’s it:

inserir a descrição da imagem aqui

You need to have a calendar dimension table (to use the itenerante function)

  1. Last Selected Value = SELECTEDVALUE(Plan1[VALOR CONVERTIDO])

  2. Last Selected Value - 1 =

CALCULATE(
    [Último Valor Selecionado];
    DATEADD(
        dCalendario[Data];-1;MONTH
    )
)
  1. Measure = [Último Valor Selecionado]/[Último Valor Selecionado - 1]

I hope you answer.

  • Good afternoon, and thank you for your answer. But in this case, I would always need to divide by the first value of the "table, in the case of ID9 I would always need to divide by 3.21. Can you tell if there is any way to redeem the first value? Thank you. Att.,

0

Modelo

First Selected Value =

> CALCULATE(
>     [Último Valor Selecionado];
>     FIRSTDATE(
>         ALLSELECTED(
>             Planilha1[DATA]
>         )
>     ) 
)

Desired Measure =

[Último Valor Selecionado]/[Primeiro Valor Selecionado]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.