# Multiple Metric in canvas

**URL:** <https://discuss.elastic.co/t/multiple-metric-in-canvas/345256>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [October 18, 2023, 8:06am UTC](https://discuss.elastic.co/t/multiple-metric-in-canvas/345256 "2023-10-18T08:06:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fay/32/122632_2.png) [@fay](https://discuss.elastic.co/u/fay)\
**Post date:** [October 18, 2023, 8:06am UTC](https://discuss.elastic.co/t/multiple-metric-in-canvas/345256/1 "2023-10-18T08:06:38Z")

</div>

Hi everyone ,  
I am using Canvas and I want to represent top 5 of field and break it down with another field  
I can simply do that in Visualization by Metric type and select Maximum of Field1 and break it down with top 5 of field 2  
in Canvas I just can bring 1 metric for the maximum only ! but I want Maximum 5 also I can't break this single metric with another field

any help please

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [October 27, 2023, 10:15am UTC](https://discuss.elastic.co/t/multiple-metric-in-canvas/345256/2 "2023-10-27T10:15:45Z")

</div>

You have two options I think:

- Save the Lens metric to the library and import it to you workpad
- Use a table to bring the data and render it together

I did both using the `eCommerce` dataset rendering the average of `products.base_price` broken by `category.keyword`:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f39d8682b186cb6c63019bcdeaefaefec272b13.png)

The table is rendering using the following SQL:

```sql
SELECT category.keyword as cat,
       round(avg("products.base_price"),2) as avg_price
FROM "kibana_sample_data_ecommerce"
GROUP BY category.keyword
ORDER BY category.keyword

```

and in markdown I render a basic table:

```markdown
| Category | Average Price |
| :-- | --: |
{{#each rows}}
**{{cat}}** | **${{avg_price}}**
{{/each}}

```

with the following styling:

```css
/* hide borders */
.canvasRenderEl table,
.canvasRenderEl tr,
.canvasRenderEl td,
.canvasRenderEl td:last-child,{
  border: none;
}
/* hide table header*/
.canvasRenderEl thead{
  display: none;
}

/* change 1st column*/
.canvasRenderEl td:first-of-type{
  vertical-align: top;
  font-size: 1.2em;
}

/* change 2nd column*/
.canvasRenderEl td:nth-of-type(2){
  line-height: 1.5em;
  font-size: 2.5em;
}

```

Hope it helps

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 24, 2023, 10:15am UTC](https://discuss.elastic.co/t/multiple-metric-in-canvas/345256/3 "2023-11-24T10:15:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
