Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi, I'm really struggling to do this.
Assume I have 'Table 1', with a list of data, and this has a relationship to 'Table 2'.
Table 2 says how the data in table 1 should be grouped. This is in column Table2[groupings]
I want to apply a measure 'Measure1' to the grouped data. Then average over the groups.
How do I do this?
I've been looking over summerize and groupby all afternoon but can't work it out. I need this done in a measure so it can update by the report level filters if someone wants to remove some data from Table1. The end goal is to apply a z score to the grouped data.
Thank you for your help
Solved! Go to Solution.
Hi @Anonymous ,
We can try use the following measure to meet your requirement:
avegrouped =
AVERAGEX (
CALCULATETABLE ( DISTINCT ( Table2[groupings] ), ALLSELECTED ( Table2 ) ),
CALCULATE ( [Measure1] )
)
If it does not meet your requirement, Could you please provide a mockup sample based on fake data or describle the fields of each tables and the relations between tables simply? It will be helpful if you can show us the exact expected result based on the tables. Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
Best regards,
I've made a very simple dataset and it's working with
Hi @Anonymous ,
We can try use the following measure to meet your requirement:
avegrouped =
AVERAGEX (
CALCULATETABLE ( DISTINCT ( Table2[groupings] ), ALLSELECTED ( Table2 ) ),
CALCULATE ( [Measure1] )
)
If it does not meet your requirement, Could you please provide a mockup sample based on fake data or describle the fields of each tables and the relations between tables simply? It will be helpful if you can show us the exact expected result based on the tables. Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
Best regards,
Thanks Dong Li,
That's worked perfectly. The problem with summerize was that my measure was a percentage using the number of items in the group. Your calculatetable managed to cope with that, when the summerize couldn't.
Not Clear.
Can you share sample data and sample output.
This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149
Thanks Greg,
I'm going to go through your example now.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
109 | |
108 | |
108 | |
91 | |
61 |
User | Count |
---|---|
171 | |
139 | |
133 | |
102 | |
86 |