Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have 16 employees from 2 countries. The Dataset contains multiple records for each employee. |
1. I need to show Total Salary per employee/country based on filters content (i.e months, country) |
Salary = SUM ( dimSalaryPerEmployee[Salary] ) |
2. I need to show Average Salary per employee/country based on filters content (i.e months, country) |
Avg = AVERAGE ( dimSalaryPerEmployee[Salary] ) |
3. I need to show Normalized Std of Salary per employee/country based on filters content (i.e months, country) |
Std = STDEV.S ( dimSalaryPerEmployee[Salary) |
I need to have a Normalized Std measure per country! Meaning each employee will be evaluated in its own country. |
Normalized Std = (Salary-Avg)/Std |
How can I tell Dax to use an Avg for the country that is in the current context? |
Thanks,
Tamir
Seems like you could just wrap those measures in a CALCULATE with a FILTER for the country or maybe I don't understand what you are asking for?
I believe you understand perfectly 🙂
I tried,
Normalized Std = calculate((Salary-Avg)/Std,ALL(dimCountries[Country])
and of course it doesn't work...
I think I need to do
Normalized Std = calculate((Salary-Avg)/Std,FILTER(dimCountries[Country]=????)
but I don't know what to put in the ????
Thank you for the help,
Tamir
Well, you could create two measures, one for each country and then you would just plug in the country name in double quotes.
It is just a sample...I have around 60 countries...
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 |
---|---|
78 | |
76 | |
53 | |
37 | |
31 |
User | Count |
---|---|
101 | |
56 | |
51 | |
45 | |
40 |