Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Good morning friends, I have a database like this below.
With the columns, bank/date/value and I need to calculate this answer column.
It is calculated as this:
I take the lowest value of the VALUE column of the bank independent of the date, i.e. ABC = 1000, TOB = 2000, NNN= n/a ,
TTT = n/a.
And decrease from that value a specific fixed number. From the ABC bank I decrease 50 and the bank TOB decrease 100. Of the seats that have nothing in the value column, I leave blank.
Can you help me please!?
BANCO | DATE | VALUE | ANSWER |
ABC | 01/01/2021 | 1000 | 950 |
TOB | 01/01/2021 | 2000 | 1900 |
TOB | 01/02/2021 | 2100 | 1900 |
TOB | 01/03/2021 | 2200 | 1900 |
ABC | 01/02/2021 | 1200 | |
NNN | 01/01/2021 | ||
TTT | 01/01/2021 | ||
ABC | 01/03/2021 | 1300 | 950 |
Solved! Go to Solution.
@felipesaw , a new column
=
var _min = minx(filter(table, [BANCO] = earlier([[BANCO]) ), [VALUE])
return
Switch(True(),
isblank(_min ) , blank() ,
[BANCO] ="ABC", _min -50 ,
_min-100
)
@felipesaw , a new column
=
var _min = minx(filter(table, [BANCO] = earlier([[BANCO]) ), [VALUE])
return
Switch(True(),
isblank(_min ) , blank() ,
[BANCO] ="ABC", _min -50 ,
_min-100
)
User | Count |
---|---|
40 | |
26 | |
22 | |
16 | |
15 |
User | Count |
---|---|
54 | |
35 | |
18 | |
17 | |
15 |