Skip to main content
cancel
Showing results for
Search instead for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Graph : Lines per category and Average line overall

Hi,

Is there a way to add automatically on average line per month on a graph?

I have in this example a cost per site per month (5  sites )  and i would like to add a line with the average monthly cost

Thanks in advance for your help

1 ACCEPTED SOLUTION
Community Support

Hi @miguesnet ,

I have created a sample for your reference, please check the following steps as below.

1. Create a calculated table as below and make it related to our fact table.

``Table 2 = UNION(VALUES('Table (2)'[category]),{"avg"})``

2. Then we can achieve that by a measure.

``````Measure =
IF (
MAX ( 'Table 2'[category] ) = "avg",
CALCULATE (
AVERAGE ( 'Table (2)'[value] ),
ALLEXCEPT ( 'Table (2)', 'Table (2)'[date] )
),
SUM ( 'Table (2)'[value] )
)
``````

For more details, please check the pbix as attached.

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
4 REPLIES 4
Super User

You can have like using Analytics . But in this case you need a measure like

Calculate([Measure],All(Site[Site]))

if you need more help make me @

Appreciate your Kudos.

Frequent Visitor

Hi,

Thanks for your answer.

I created a new measure as you describe but i can not combine both measures on the same graph. It must be possible

Community Support

Hi @miguesnet ,

I have created a sample for your reference, please check the following steps as below.

1. Create a calculated table as below and make it related to our fact table.

``Table 2 = UNION(VALUES('Table (2)'[category]),{"avg"})``

2. Then we can achieve that by a measure.

``````Measure =
IF (
MAX ( 'Table 2'[category] ) = "avg",
CALCULATE (
AVERAGE ( 'Table (2)'[value] ),
ALLEXCEPT ( 'Table (2)', 'Table (2)'[date] )
),
SUM ( 'Table (2)'[value] )
)
``````

For more details, please check the pbix as attached.

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Super User

March Release has a multi-axis line chart. And I remember that bar -line was only splitting bar. Check and try

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-march-2020-feature-summary/

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors