Forum Discussion
How to create average formule based on different data
- Anonymous2 years ago
Hi Dcichy ,
May I ask if your problem has been solved. If the above reply was helpful, you may consider marking it as solution. If the problem is not yet solved, you can follow the steps below:
Add new measure:
result = VAR _total = CALCULATE ( SUM ( 'Table'[days] ), FILTER ( ALL ( 'Table' ), 'Table'[Task] = SELECTEDVALUE ( 'Table'[Task] ) ) ) VAR _count = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALL ( 'Table' ), 'Table'[Task] = SELECTEDVALUE ( 'Table'[Task] ) ) ) RETURN _total / _countFinal output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
not clear about this. You want the average. Thne you said for task 1 the sum is 12. Then what's the expected output?
- Dcichy2 years agoNew Member
Hi ryan_mayu
I meant that sum of days for task 1 is 4+8, because this tasks appears twice, and this formula should count it as 12 because this is one task with duration splited into two- ryan_mayu2 years agoSuper User
- Dcichy2 years agoNew Member
I mentioned very simple example. I tried to support myself with ChatGPT but i doesn't work. ChatGPR suggested to creat first column like this:
Averageoftasks=SUMMARIZE(Tasks, Tasks[TaskName], "Sumdays", SUM(Tasks[task duration ]))
and then measure:
SredniaDniZadan =
AVERAGEX(
Averageoftasks,
[Sumdays]
)
I received problem like: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.