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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JGroothedde
Resolver II
Resolver II

Getting an average where columns match

Hi there friends,

I have data like below:

IDPerson    Job type    Job option    Job category    Hourly rate    Average rate    
134Type 1Option 1On-site6058,33
135Type 2Option 1On-site5558,33
136Type 1Option 1On-site7558,33
137Type 4Option 4Remote4058,33
138Type 1Option 3Remote6058,33
139Type 5Option 1On-site6058,33


What would be the best way, in DAX, to get the average based on matching columns? So instead of a general average of the hourly rate calculated over all rows, i need the average to be calculated based on matching columns (aside from the person ID). So the average in the first row should be calculated for rows where job type = Type 1, job option = Option 1, category = On-site.

What's the best way to accomplish this? I'm stumped.

Cheers in advance!

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @JGroothedde - create a below calculated column that dynamically calculates the average for each row based on the specified conditions

calculated column:

 

Average rate =
CALCULATE(
    AVERAGE('Avger'[Hourly rate]),
    ALLEXCEPT('Avger', 'Avger'[Job type], 'Avger'[Job option], 'Avger'[Job category])
)
 

rajendraongole1_0-1721843339276.png

Hope it helps

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @JGroothedde - create a below calculated column that dynamically calculates the average for each row based on the specified conditions

calculated column:

 

Average rate =
CALCULATE(
    AVERAGE('Avger'[Hourly rate]),
    ALLEXCEPT('Avger', 'Avger'[Job type], 'Avger'[Job option], 'Avger'[Job category])
)
 

rajendraongole1_0-1721843339276.png

Hope it helps

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you so much for getting me out of this, for some reason I kept trying to do this in a measure. Thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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