##### New member

- Joined
- Feb 3, 2023

- Messages
- 4

- Thread Author
- #1

I'm working on a Power BI Deneb visual, using original (not Lite) Vega syntax. I'm trying to calculate a maximum value from a column of my dataset, containing only integers. I could do this on Power BI side and pass max as a repeated argument in dataset, but for performance reasons I would like to calculate it on Vega side.

Could someone give me a tip on how to do it? Feels like transform of a formula or aggregate type, but I can't figure it out.

Thats:

That was my first idea, but obviously it sees only row context so it finds max of one value instead of entire column:

Could someone give me a tip on how to do it? Feels like transform of a formula or aggregate type, but I can't figure it out.

Thats:

That was my first idea, but obviously it sees only row context so it finds max of one value instead of entire column:

Code:

```
"data": [
{
"name": "dataset",
"transform": [
{
"type": "formula",
"as": "maxValue",
"expr": "max(datum['ColumnWhereILookForMax'])"
}
]
}
```