Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a measure for calculationg average of number of days since last input.
I want to have another measure showing group average after filtering specific project to compare project with the group. I used function ALL to ignore the project filter but it is diving me average for all groups instead of the one i want.
Group | average days | days group average |
abc | 10 | 10 |
def | 20 | 20 |
ghi | 30 | 30 |
20 | 20 |
measure = calculate([average], ALL(project[id]))
when selecting one project from group abc, I need the other measure to be showing 10 as group average for abc but its showing average for all groups - 20
i wanted to try groupby but as my average is calculated measure i didnt think it would be useful.
how to show second average for group ? when i select one project i want to see the average for the group the product is in.
Solved! Go to Solution.
Hi @Anonymous ,
Try this:
average = AVERAGE ( 'Table'[Days average] )
divisional average = AVERAGEX ( 'Table', CALCULATE ( AVERAGE ( 'Table'[Days average] ), ALLEXCEPT ( 'Table', 'Table'[Group] ) ) )
Best Regards
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Try this:
average = AVERAGE ( 'Table'[Days average] )
divisional average = AVERAGEX ( 'Table', CALCULATE ( AVERAGE ( 'Table'[Days average] ), ALLEXCEPT ( 'Table', 'Table'[Group] ) ) )
Best Regards
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
superb !! thank you so much for this !
would this work in a table as well ? I need a column in a table where for each row i want to see this group average (no not only when i select specific group).
I created this sample of data :
Product | Group | Days average |
a | abc | 50 |
b | abc | 60 |
c | abc | 80 |
d | abc | 100 |
e | abc | 500 |
f | abc | 100 |
h | abc | 50 |
i | abc | 60 |
j | def | 70 |
k | def | 100 |
l | def | 100 |
m | def | 120 |
n | def | 140 |
o | def | 150 |
p | def | 160 |
I want to have a measure showing average for product(s) and another one showing average for division. (i will have 2 cards next to each other for comparison)
e.g. when i select project a it gives me : average 50, divisional average 125
@Anonymous you can achieve this by following measures
Average by group = CALCULATE(AVERAGE('Table 2'[Days average]),ALL('Table 2'[Product])) Average by Product = CALCULATE(AVERAGE('Table 2'[Days average]),ALL('Table 2'[Group]))
Hi @Anonymous ,
You can use ALLSELECTED. And it would be great if you could provide some sample data.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
could you include a sample version of your Power BI file?
You can share it via DropBox, One Drive, Drive or any similar tool.
Regards
LC
User | Count |
---|---|
116 | |
73 | |
62 | |
50 | |
46 |
User | Count |
---|---|
173 | |
123 | |
60 | |
59 | |
57 |