# Moving Average in Lens

**URL:** <https://discuss.elastic.co/t/moving-average-in-lens/362487>\
**Category:** Kibana\
**Tags:** visualisation\
**Created:** [July 3, 2024, 6:14pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487 "2024-07-03T18:14:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)\
**Post date:** [July 3, 2024, 6:14pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/1 "2024-07-03T18:14:39Z")

</div>

Hello,

I created this TVSB visualization using a moving average to show the line:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/0/002a52da2a70d0051330a986d58c560fa3e08a0c.png)

I clicked on convert to lens and it turns it like this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/6/e60f4be062834cefb5db5e0d39114ac99e7b197c.png)

The issue I think is that TVSB allows you choose the style per layer while Lens only lets you choose one style

![image](https://us1.discourse-cdn.com/elastic/original/3X/4/3/43a716756a79caf6460d597bdaa87d9ca3385d36.png)

Is there a workaround to this? or is it best bet to stick to TVSB?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 3, 2024, 6:42pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/2 "2024-07-03T18:42:48Z")

</div>

Hi @erikg

What version are you on?

Simply add them as 2 different Series

One Bar (your Count)  
One Line (your moving average)

 ![Screenshot 2024-07-03 at 11.41.24 AM](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90f2fa1822518b6b25b8c2e9b963a8a3fd980a2c.jpeg)

---

<div class="post-metadata">

**Author:** ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)\
**Post date:** [July 3, 2024, 6:49pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/3 "2024-07-03T18:49:21Z")

</div>

Hey @stephenb  
I am dumb!  
But wait that seems like it works but what if I want to keep it as a line but as step

Kibana Version: 8.14.1

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 3, 2024, 8:25pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/4 "2024-07-03T20:25:48Z")

</div>

poke around my friend ...

 ![Screenshot 2024-07-03 at 1.22.16 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a12283623d8ef3883dbc61eae8196c226660ae0.png)

---

<div class="post-metadata">

**Author:** ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)\
**Post date:** [July 3, 2024, 8:55pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/5 "2024-07-03T20:55:35Z")

</div>

Hey @Stephen haha yeah I understand  
but hear me out,

I want area with step (instead of bar vertical) and default line for moving average?

If you do that in Lens, it will make both layers stepped or default.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 3, 2024, 10:08pm UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/6 "2024-07-03T22:08:09Z")

</div>

> [@erikg](#):
>
> If you do that in Lens, it will make both layers stepped or default.

Yup looks like the case...

If that is a "Hard" requirement, then you can stick with TSVB... which is not really getting updated as Lens is the future...

Bar and Squared Area are essentially the same... but I understand folks are particular....

So my first Image is a close are you are going to get at this point

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [July 4, 2024, 8:59am UTC](https://discuss.elastic.co/t/moving-average-in-lens/362487/7 "2024-07-04T08:59:28Z")

</div>

I've created a feature request you can track: [[Lens] Ability to define line interpolation style per layer · Issue #187543 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/187543)
