Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Average Dynamic Dax

Hello,

 

I'm working on a dynamic dax to calculate the average duration as is shown in the picture. 

Capture.PNG

So :

for the 1st example, the first line has one data on duration stage 2 so the average is gonna be: 750 

for the 2nd example the 10th line has 2 data in duration stage 1: 504 and duration stage 2: 286 so the average is gonna be 504+286/2 = 395 

for the 3rd example the line 18th has 2 data in duration stage 2: 184 and duration stage 3: 1340 so the average is gonna be 184+13402 = 762 

for the 4th example the line 24th has 3 data in duration stage 1: 1018 and duration stage 2 : 0 and duration stage 3: 3652 so the average is gonna be 1018+0+3652 / 3 = 1556.66

and if we have data for all duration stages the average is gonna be: duration stage 1 + duration stage 2 + duration stage 3 + duration stage 4 /4

 

the formula that I'm using is : 

Average duration = DIVIDE(AVERAGE(Projects[Duration Stage 1])+AVERAGE(Projects[Duration Stage 2])+AVERAGE(Projects[Duration Stage 3])+AVERAGE(Projects[Duration Stage 4]),4,0)

 

Thank you very much

Regards,

1 REPLY 1
Stachu
Community Champion
Community Champion

Can you add sample input tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1 Column2
A 1
B 2.5

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors