Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
Im looking for a single measure I can place in a card that displays the average number of items in a group category.
In the dataset below, I'd like the card to display 3 which is the average count of Item Codes per Office Location. Item codes are unique.
Have tried several variants using GROUPBY but no success. Thanks for any help!
Data | Looking for overall average: | |||||
Office Loc code | Office | Item Code | Avg Items | |||
OfficeA | Office location A | A00025 | OfficeA | 4 | ||
OfficeA | Office location A | A00049 | OfficeB | 2 | ||
OfficeA | Office location A | A00073 | OfficeC | 3 | ||
OfficeA | Office location A | A00193 | Overall Average: | 3 | ||
OfficeB | Office Location B | A00313 | ||||
OfficeB | Office Location B | A00385 | ||||
OfficeC | Office Location C | A00409 | ||||
OfficeC | Office Location C | A00481 | ||||
OfficeC | Office Location C | A00505 |
Solved! Go to Solution.
Hi,
pls see below:
Measure = AVERAGEX(VALUES('Table'[Office]), CALCULATE(DISTINCTCOUNT('Table'[Item Code])))
File is attached.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Hi,
pls see below:
Measure = AVERAGEX(VALUES('Table'[Office]), CALCULATE(DISTINCTCOUNT('Table'[Item Code])))
File is attached.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
That works great - thanks!
User | Count |
---|---|
54 | |
22 | |
19 | |
16 | |
11 |
User | Count |
---|---|
82 | |
55 | |
39 | |
20 | |
12 |