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.
Hi ,
I have a dataset like below:
I've calculate average 'Duration' group by 'Application',
DAX: avg_duration = CALCULATE(AVERAGEX('AP tbltimecard_engineering_system',
my next step is get sum of each application's average value
now I write hard code '1.23' into a measure ,
and I've tried every solution that I know on DAX,but still can't do what I want.Solved! Go to Solution.
Hi @lchi08978 ,
I suggest you to try this code to create [avg_duration] measure.
avg_duration =
VAR _SUMMAZIRE =
SUMMARIZE (
'AP tbltimecard_engineering_system',
'AP tbltimecard_engineering_system'[ApplicationName],
"avg_duration",
CALCULATE (
AVERAGE ( 'AP tbltimecard_engineering_system'[Duration] ),
ALLEXCEPT (
'AP tbltimecard_engineering_system',
'AP tbltimecard_engineering_system'[ApplicationName]
)
)
)
RETURN
SUMX(_SUMMAZIRE,[avg_duration])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lchi08978
Can you try the below measure and see if it works?
Regards,
Kishore
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@lchi08978 , Try a measure like
calculate( AverageX(Values('AP tbltimecard_engineering_system'[Application Name]), [avg_duration ]), allselected())
Hi @amitchandak ,
I tried your measure,but the output seems not I want,
result:
did I write something wrong?
and thank you for your reply!
Hi @lchi08978 ,
I suggest you to try this code to create [avg_duration] measure.
avg_duration =
VAR _SUMMAZIRE =
SUMMARIZE (
'AP tbltimecard_engineering_system',
'AP tbltimecard_engineering_system'[ApplicationName],
"avg_duration",
CALCULATE (
AVERAGE ( 'AP tbltimecard_engineering_system'[Duration] ),
ALLEXCEPT (
'AP tbltimecard_engineering_system',
'AP tbltimecard_engineering_system'[ApplicationName]
)
)
)
RETURN
SUMX(_SUMMAZIRE,[avg_duration])
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |