Two Calculations in a Dax Formula Based on Another Field

Anything related to PowerPivot and DAX Formuale
mjw_1986
Posts: 1
Joined: Thu Sep 19, 2019 9:47 pm

Two Calculations in a Dax Formula Based on Another Field

Postby mjw_1986 » Thu Sep 19, 2019 10:01 pm

Hi,

I'm struggling with making a calculation for a DAX measure where I want to perform a different average calculation based on a condition in another field. I have messed around with CALCULATE and IF and SWITCH but afraid my abilities have left me short. If anybody could take a look at my explanation and help me tackle this I would be most grateful.

I have one field which is a simple Trainer/Non Trainer field, where obviously some rows are Trainer and some are Non Trainer, which has been created as a Calculated Column based on their job title.

If their job is "Trainer", then I would like to sum up their pay amount and divide by a fixed numeric value, e.g "100"

If their job is "Non Trainer", then I would like to sum up their pay amount and divide by the distinct count of employee codes. (Employee Code is another field and the distinct count has been created in the pivot table)

MattAllington
Posts: 1062
Joined: Sun May 04, 2014 4:01 pm
Location: Sydney, Australia

Re: Two Calculations in a Dax Formula Based on Another Field

Postby MattAllington » Sat Sep 21, 2019 4:19 pm

Matt Allington is Self Service BI Consultant, Trainer and Author of the Book "Supercharge Power BI".
Power BI Training


Return to “PowerPivot/DAX”

Who is online

Users browsing this forum: No registered users and 2 guests

cron