Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello. (sorry for the earlier incomplete post). I am new to power BI. I would like a measure to do a Distinct Average of a column using two (or more) categories for grouping.
ID DATE Type Data1 Data2 Data3...etc.
1 01/01/2020 A 3 8
1 01/01/2020 B 5 2
1 01/01/2020 B 5 4
1 01/01/2020 B 5 3
1 01/01/2020 C 7 1
1 01/01/2020 C 7 2
2 01/01/2020 C 7 2
2 01/01/2020 C 7 1
etc...
I would like the Distinct AVG_ID_DATE measure to give: average for Data 1 (ID/Date/Type):
ID DATE AVG_ID_DATE
1 01/01/2020 5 (3+5+7)/3
Thanks!
Solved! Go to Solution.
I tried the 2nd suggestion, it worked. Thanks!
To add a 3rd group_by category, just add it to the summarize table?
averageX(summarize(Table, Table[ID], Table[DATE],Table[Type],"_1", max(Table[Data1])),[_1])
@Anonymous I suggest transforming such a 2-dimensional into a 1-dimensional table in the first place, so that a versatile measure can be authored instead of specific Data1, Data2, ...
Measure = AVERAGEX ( DISTINCT ( DS ), DS[Value] )
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
That probably would simplify things (a simpler table). Thanks!
@Anonymous ,
Try like
Averagex(union(distinct(Table2[Value]),distinct(Table2[Value])),[Value])
Can you share sample data and sample output in table format?
Sorry. See edited post above...I tried to clarify why I need distinct average...
@Anonymous , Try as a new measure
averageX(values(Table[Type]), max(Table[Data1]))
or
averageX(summarize(Table,Table[DATE],Table[Type],"_1", max(Table[Data1])),[_1])
I tried the 2nd suggestion, it worked. Thanks!
To add a 3rd group_by category, just add it to the summarize table?
averageX(summarize(Table, Table[ID], Table[DATE],Table[Type],"_1", max(Table[Data1])),[_1])
@Anonymous Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
10 | |
6 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |