Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi guys
I've got tricky question about creating new Average formule. I would like to create formula which will show average of days from specyfic tasks. Tasks should be calculated as for example: task 1 is typed twice so sum of this task equals 12, task 2 lasts 3 days, task 4 lasts 7 days.
Task days
1 4
1 8
2 3
3 7
Solved! Go to Solution.
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 / _count
Final 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
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 / _count
Final 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?
Proud to be a Super User!
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
you can use sum(days)
not sure if this is the output that you want
Proud to be a Super User!
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:
why not create a measuer and use average?
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
19 | |
17 | |
12 | |
9 | |
9 |