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.
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."
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 |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
13 | |
11 | |
8 |