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

Reply
ChrisPBI
Advocate II
Advocate II

Data Model Value Average

Hello,

 

my data model says that a product can have emissions in four life cycle stages.

 

Example for product XY with A to D as the life cycle stages as table values:

 

Product    Life Cycle Stage   Value

    XY                   A                    10

    XY                   B                    20

    XY                   C                     5

    XY                   D                   15

 

Therefore each product has four rows in the relationship table.

 

When I want to calculate the Average of all emissions (values) the answer in this example

should be 50 since there is only one product. But it is calculated 50 / 4 =12,5.

 

Do I have to change the underlying tables or why is the calulation wrong?

 

Thanks and Regards,

Chris

1 ACCEPTED SOLUTION
KGrice
Memorable Member
Memorable Member

Hi @ChrisPBI. If you use =AVERAGE(TableName[Value]), you'll get 12.5. To get the sum of the value column divided by the number of products, you could use this measure:

 

Measure = SUM(TableName[Value]) / DISTINCTCOUNT(TableName[Product])

 

For your sample, that should evaluate to 50 / 1 = 50.

View solution in original post

1 REPLY 1
KGrice
Memorable Member
Memorable Member

Hi @ChrisPBI. If you use =AVERAGE(TableName[Value]), you'll get 12.5. To get the sum of the value column divided by the number of products, you could use this measure:

 

Measure = SUM(TableName[Value]) / DISTINCTCOUNT(TableName[Product])

 

For your sample, that should evaluate to 50 / 1 = 50.

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.