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.
Hi Community!
I have a, hopefully, easy question - and was looking to accomplish via a measure. I have a Subject field - which contains a variety of task types: Initial Attempts, Meeting, Close-Out, etc.
My goal is to count the total number of Initial Attempts - which are categorized as Initial Attempt 1, Initial Attempt 2, and so on, up to 10. I used the below code to get a total, but now I'd like to calculate the average number of Initial Attempts.
"My goal is to count the total number of Initial Attempts - which are categorized as Initial Attempt 1, Initial Attempt 2, and so on, up to 10. I used the below code to get a total, but now I'd like to calculate the average number of Initial Attempts."
Instead of writing long DAX and remembering to update the code when something changes, you should massage the data in Power Query first and foremost. Create a column (say, Subject Group) in the table and put in a row an entry like "Initial Attempt" if the row contains any of the initial attempts (this new column would be hidden most likely but not necessarily). Then calculating the number of inital attempts will be dead easy. Just count the initial attempts in the context:
[# Initial Attempts] =
CALCULATE(
COUNTROWS( T ),
KEEPFILTERS(
T[Subject Group] = "Initial Attempt"
)
)
By the way, I don't understand what kind of average you're talking about... To get the number of "Attempt 1" you'd just slice by this entry and the above measure will return the number. Same is true for any other "Attempt."
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |