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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
clem312
Resolver I
Resolver I

Line chart - Combine measure and average ?

Hello,

 

I have a table as below :

Year	Brand	Notation
2019	Brand 1	10
2015	Brand 1	9
2019	Brand 1	8
2019	Brand 2	10
2016	Brand 2	9
2019	Brand 2	7
2019	Brand 2	8
2019	Brand 3	8
2015	Brand 3	9
2019	Brand 3	10
2019	Brand 3	7
2016	Brand 1	4
2017	Brand 1	7
2018	Brand 1	6
2019	Brand 3	1

I need to make a line chart with year on X and Average on Y.

One line for each brand.

That I can do. What I can't do, is to add a line "Average of all brands" for each year.

I can't find out how.

Like this :

Capture d’écran 2021-06-10 234120.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @clem312 ,

 

Sorry for my negligence. Please check my new attachment.

2.png

 

1.I create a new seperate table like

Table 2 = CROSSJOIN( UNION( VALUES('Table'[Brand]), {"Average"}), VALUES('Table'[Year]))

3.png

 

2.Then create the measure

Measure = IF(MAX('Table 2'[Brand])="Average",  CALCULATE(SUM('Table'[Notation]) / DISTINCTCOUNT('Table'[Brand]),FILTER('Table','Table'[Year]=MAX('Table 2'[Year]))) , CALCULATE(SUM('Table'[Notation]),FILTER('Table','Table'[Brand]=MAX('Table 2'[Brand]) && 'Table'[Year]=MAX('Table 2'[Year])  )))

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @clem312 ,

 

You can create a table like

Screenshot 2021-06-16 150622.png

 

There's a relationship between the new table and the main table.

Screenshot 2021-06-16 150716.png

Measure = IF(MAX('Table (2)'[Brand])="Average of all brands",CALCULATE(AVERAGE('Table'[Notation]),ALLEXCEPT('Table','Table'[Year])),SUM('Table'[Notation]))

Screenshot 2021-06-16 150822.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

In a simple Table, please show the expected result.  Once we get the result in a Table, we can build any visual.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

It's not that simple. You have multiple values per brand and year, so you will need to define what you mean by "Average".  Below example uses ALLEXCEPT and calculates the average of all values per year. This may or may not be what you intended.

lbendlin_0-1623542154656.png

Avg = CALCULATE(AVERAGE('Avg'[Notation]),ALLEXCEPT('Avg','Avg'[Year]))

If you need a line chart for all values then you can either merge tables (if calculated columns are ok) or you need to create separate measures for the brands plus one for the average.

Hi @lbendlin,

 

Thank you for your answer.

The average requested is the sum of average of each brand average divided by the number of brand. So that we have an average of the industry for each year.

 

Best regards,

Clement

Anonymous
Not applicable

Hi @clem312 ,

 

Sorry for my negligence. Please check my new attachment.

2.png

 

1.I create a new seperate table like

Table 2 = CROSSJOIN( UNION( VALUES('Table'[Brand]), {"Average"}), VALUES('Table'[Year]))

3.png

 

2.Then create the measure

Measure = IF(MAX('Table 2'[Brand])="Average",  CALCULATE(SUM('Table'[Notation]) / DISTINCTCOUNT('Table'[Brand]),FILTER('Table','Table'[Year]=MAX('Table 2'[Year]))) , CALCULATE(SUM('Table'[Notation]),FILTER('Table','Table'[Brand]=MAX('Table 2'[Brand]) && 'Table'[Year]=MAX('Table 2'[Year])  )))

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors