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
Anonymous
Not applicable

Obtain Simple Average instead of Weighted Average

Hi!

 

I need that the following table visual displays the simple average instead of the weighted average:

 

afontesc_0-1628065618606.png

The simple average should just be 3.9 in the first column and 36.7 in the second one.

 

Context:

 

The result displayed by the Total row is the Weighted Average because the region of Dakar has more opportunities in it than the regions of Bangkok and Amman. This means that in the first column the value 9.7 from Dakar has more weight than the other regions, because the region of Dakar has more information than the other two regions.

 

It is required that the simple average should be displayed. 

 

The data model looks like this (notice the direction of the relationships):

 

afontesc_2-1628066637321.png

 

In the first table, the column 'Draft to Submitted' is a KPI that calculates the average value for a certain KPI Code. The DAX for this measure is:

 

Draft to Submitted =
CALCULATE(
AVERAGE('Opportunity KPI'[KPI Value]) ,
'Opportunity KPI'[KPI Code] = "DRAFT-SUBMITTED"
)

 

Then the table simply displays this KPI by Region Code from the Region table. The total is the weighted average and the simple average is required in this case.

 

I am not sure if this is possible or if I am doing something wrong regarding the measure or the structure of the data model, but any help on this would be much appreciated.

 

Thanks for your time!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

maybe try something like below

=if(hasonevalue(region),[Draft to Submitted], averagex(values(region),[Draft to Submitted])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

maybe try something like below

=if(hasonevalue(region),[Draft to Submitted], averagex(values(region),[Draft to Submitted])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thank you so much! This works

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.