The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Apologies in advance because I feel like I'm missing something obvious here, however I'm simply trying to write a measure that produces the average of the values across multiple columns (ultimately I'll have a slicer to display the resulting value based on month). For example, with data like this (illustration purposes only).
Value1 | Value | Value3 | Value3 | Value5 | Value6 |
5 | 10 | 20 | 30 | 40 | 50 |
And this formula
TotalAvg = (SUM('Table1'[Value1]) + SUM('Table1'[Value2]) + SUM('Table1'[Value3]) + SUM('Table1'[Value4]) + SUM('Table1'[Value5]) + SUM('Table1'[Value6])/6)
The output value isn't what I'd expect (26), it's a much higher number (in my real data the values for 1 row are 60, 44, 22, 33, 36, 37 and the output of the formula is producing 201.17 instead of 39).
Again, I feel like I'm missing something obvious here and have tried several things, and read several other "average across multiple columns" discussions to no avail.
Thanks!
Solved! Go to Solution.
hello @jmscrx
your DAX looks good but you misplaced your bracket. This DAX means Value6 got divided by 6 then add to Value1 up to Value5.
tried your data with your DAX and the result is as you need.
Hope this will help you.
Thank you.
hello @jmscrx
your DAX looks good but you misplaced your bracket. This DAX means Value6 got divided by 6 then add to Value1 up to Value5.
tried your data with your DAX and the result is as you need.
Hope this will help you.
Thank you.
@Irwan - I knew it was something silly that I was missing. Updated my DAX and this is working now as expected.
THANK YOU!
User | Count |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |