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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
ovetteabejuela
Impactful Individual
Impactful Individual

DAX Simple Math | Not Averaging or Aggregating Properly or it is just me?

Hi COmmunity,

 

Why is this not doing average:

 

NumDenColumn1
23.424479A
24.365230B
23.313823C
23.815577D
23.883948E
23.875846F

 

NotAveraging.PNG

1 ACCEPTED SOLUTION

@ovetteabejuela,

 

You could try this:

Measure = 
DIVIDE(
	SUMX( Table1; Table1[Num] * Table1[Den]);
	SUM(Table1[Den])
)
/sdjensen

View solution in original post

8 REPLIES 8
vanessafvg
Super User
Super User

@ovetteabejuela well according to your calculation its coming up with the correct value.  What are you trying to do?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg

 

NotAveraging_2.PNG

 

I want to achieve highlighted in yellow

asd = sorry about the field name but it is just Num * Den (23.42 * 4479 = 104898.2)

@ovetteabejuela are you not wanting this? 

 

measure = divide(sum(num)/countrows(table of denominator))





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




That is just like straight average, I'm doing some kind of reverse calculation here to get the correct average:

 

NotAveraging_3.PNG

@ovetteabejuela,

 

You could try this:

Measure = 
DIVIDE(
	SUMX( Table1; Table1[Num] * Table1[Den]);
	SUM(Table1[Den])
)
/sdjensen

Thanks @vanessafvg and @sdjensen,

 

So that's what I should be using SUMX! I'll read about that to understand the equation more.

@ovetteabejuela so then why not just calculate(divide(sum(num),sum(den))





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Sorry the field names are misleading... here, how about this:

 

NotAveraging_4.PNG

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.