Forum Discussion
nanacobsbs
1 year agoHelper I
Average Dax
The matrix is shown in Fig and Dax Dommand is bellow.
Average = AVERAGE('Test'[Nov])
I would like to display the averaged results on each row, what DAX should I use?
I want the total row to have the same value as the maximum of the selected DATE numbers.
12 Replies
- bhanu_gautamSuper User
nanacobsbs , Try using
DAX
Average =
IF(
HASONEVALUE('Test'[DATE]),
AVERAGE('Test'[Nov]),
MAXX(ALL('Test'[DATE]), 'Test'[Nov])
)- nanacobsbsHelper I
Thank you, but it does't work.
I would like to get the following calculation results.
Is it possible?- bhanu_gautamSuper User
nanacobsbs Try this one
RunningAverage =
IF(
HASONEVALUE('Test'[DATE]),
CALCULATE(
AVERAGEX(
FILTER(
ALL('Test'[DATE]),
'Test'[DATE] <= MAX('Test'[DATE])
),
'Test'[Nov]
)
),
CALCULATE(
AVERAGEX(
ALL('Test'[DATE]),
'Test'[Nov]
)
)
)
- Ray_MindsSolution Supplier
nanacobsbs Please find the solution :
Average Unit Price =
Average :=IF (HASONEVALUE ( 'Test'[Date] ),AVERAGE ( 'Test'[Nov] ),CALCULATE (AVERAGE ( 'Test'[Nov] ),'Test'[Date] = MAX ( 'Test'[Date] )))