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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Average time to promotion in each grade

Hi- Still a newbie at Dax.  I am trying to calculate the average time to promotion for each grade.  I created a calculated table and calculate the duration in this table MyData


My Dax to create the table:

Fact Promotion =
SUMMARIZE (
Fact_Gender_Race,
Fact_Gender_Race[Full Name],
Fact_Gender_Race[Salary Effective Date],
Fact_Gender_Race[Salary To Date],
Fact_Gender_Race[Salary Change Reason],
Fact_Gender_Race[AdjGrade],
"Duration", DATEDIFF ( MIN ( Fact_Gender_Race[Salary Effective Date] ), MAX (Fact_Gender_Race[AdjEndDate] ), MONTH )
)

 

How do I write the average of time to promotion?

 

Thank you for helping!

 

3 REPLIES 3
Anonymous
Not applicable

Average Time To Promotion = AVERAGE( 'Fact Promotion'[Duration] )

Best

Darek

Anonymous
Not applicable

Hi Darek

 

That won't work since the duration should be based on the sum of the grade.  So first, I need to group by the grades, get sum of the duration by grade, then calculate average.

 

 

Anonymous
Not applicable

[AVGTTP] =
averagex(
	values( Fact[AdjGrade] ),
	calculate(
		SUM( Fact[Duration] )
	)
)

Best

Darek

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors