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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
miguesnet
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 costPower Bi _ cost per site per month.png

Thanks in advance for your help

 

1 ACCEPTED SOLUTION

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] )
)

2.PNG

 

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.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@miguesnet 

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

 

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

 

Also refer :https://docs.microsoft.com/en-us/power-bi/desktop-analytics-pane

 

 if you need more help make me @

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

 

 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

Power Bi _ cost avgeper month.pngPower Bi _ cost per site per month.png

 

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] )
)

2.PNG

 

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.

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/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.