Forum Discussion
mrlex
3 years agoNew Member
Creating a table of averages based on two categories
Stuck on this one and I am a little unclear whether it is best to do this with DAX or in the query editor.
Creating new tables with formulas is a little new for me.
I have a large table with values like so:
Table Name: Document Views
| Topic | Subtopic | Document | Views | Clicks | Likes |
| PowerBI | DAX | Doc 1 | 15 | 2 | 3 |
| PowerBI | DAX | Doc 2 | 20 | 3 | 5 |
| Excel | Pivot Tables | Doc 3 | 26 | 5 | 2 |
| PowerBI | M | Doc 4 | 22 | 1 | 1 |
| Excel | Pivot Tables | Doc 5 | 11 | 2 | 5 |
I want to create a new table with averages across the Topic and Subtopic. Something like this:
| Topic | Subtopic | Avg. Views | Avg. Clicks | Avg. Likes |
| PowerBI | DAX | 17.5 | 2.5 | 4 |
| PowerBI | M | 22 | 1 | 1 |
| Excel | Pivot Tables | 18.5 | 3.5 | 3.5 |
Can anyone recommend the best approach for this?
Really appreciate anyone who can help me!!
1 Reply
- MohammadLoran25
Solution Sage
Hi,
You just need to put your Topic and Subtopic fields in a new table visual in power bi and put a measure in the table visual as well which its fomula should be like below:
AverageView=
AVERAGE('TABLE'[VIEWS])And similar for the other measures.If this answer solves your problem, please mark it as an accepted solution so the others would find what they need easier.Regards,Loran