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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HarryB
Resolver I
Resolver I

Average of measure in a table

Hi Support,

 

The below are measures which I have created in PBI

Class Types 1-2 =
CALCULATE([User Learner Types],ga4_data[audience]="1-2")

Class Types 2-3 =
CALCULATE([User Learner Types],ga4_data[audience]="2-3")

Class Types 3-4 =
CALCULATE([User Learner Types],ga4_data[audience]="3-4")

Class Types 5-6 =
CALCULATE([User Learner Types],ga4_data[audience]="5-6")

 

1) What measure in dax can I create to get the average from these 4 measures and display them in a table

HarryB_0-1712345490800.png

2) How can I get all all 4 measure on one Line chart graph as per below with the average as line number 5 which is the dotted graph

HarryB_2-1712345846643.png

 

The bottom axis of the chart will have weeks and class types.

 

Thanks

1 ACCEPTED SOLUTION
marcelsmaglhaes
Super User
Super User

@HarryB ,

To achieve this in Power BI, you can follow these steps:

 

1 - Create a new measure to calculate the average of the four measures:
Average_Class_Types = (([Class Types 1-2]) + ([Class Types 2-3]) + ([Class Types 3-4]) + ([Class Types 5-6])) / 4

2 - Create a line chart with all four measures and the average measure:

    • Place the dates or categories on the axis of the line chart.
    • Add the four measures ([Class Types 1-2], [Class Types 2-3], [Class Types 3-4], [Class Types 5-6]) to the Values area of the line chart.
    • Add the Average_Class_Types measure to the Values area as well.
    • Customize the visual as needed to display the lines with different colors/styles.
    • Ensure that the visual is showing the data as you expect, with all four measures and the average displayed correctly

This setup will give you a line chart with all four measures displayed as lines, and the average displayed as a fifth line. You can customize the visual further to adjust the colors, styles, and other formatting options as desired.


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

 

marcelsmaglhaes
Super User
Super User

@HarryB ,

To achieve this in Power BI, you can follow these steps:

 

1 - Create a new measure to calculate the average of the four measures:
Average_Class_Types = (([Class Types 1-2]) + ([Class Types 2-3]) + ([Class Types 3-4]) + ([Class Types 5-6])) / 4

2 - Create a line chart with all four measures and the average measure:

    • Place the dates or categories on the axis of the line chart.
    • Add the four measures ([Class Types 1-2], [Class Types 2-3], [Class Types 3-4], [Class Types 5-6]) to the Values area of the line chart.
    • Add the Average_Class_Types measure to the Values area as well.
    • Customize the visual as needed to display the lines with different colors/styles.
    • Ensure that the visual is showing the data as you expect, with all four measures and the average displayed correctly

This setup will give you a line chart with all four measures displayed as lines, and the average displayed as a fifth line. You can customize the visual further to adjust the colors, styles, and other formatting options as desired.


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



@marcelsmaglhaes  your solution worked well thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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