Forum Discussion
AVERAGE BY CATEGORY
v-xjiin-msft Anonymous Zubair_Muhammad
I need help with DAX to create a measure
I have a table with Vessel name and Tonnage Capacity
| Vessel Name | Tonnage Capacity |
| Vessel ABC | 0 |
| Vessel XYZ | 25202.11 |
| Vessel YTJ | 29881.42 |
| Vessel IUK | 31085.14 |
| Vessel LMN | 27712.07 |
I want to create a measure called Tonnage Capacity of Vessel which will throw the corresponding Tonnage Capacity for every vessel when I want to create power pivots etc
I have tried using the following measures
- Anonymous4 years ago
Hi Anonymous
It was solved, Anonymous sent me files. It was an Excel connected to PBI dataset, using fact table column to retrieve data from dim table.
10 Replies
- StefanoGrimaldiResident Rockstar
if its for a simple visual a simple average function with nothing more will work, when you put in a visual table the average value dax + the category or vessel name the in build filter of the visual will separate that average dax by the category you added,
asl tyou can try something like this:
dax name =
var X = "put there the column name of the category column"
var y = calculate(average(value field), category field column = X)
return Y
- AnonymousNot applicableI am unable to create the measure as you have directed. Please refer the screenshot belowJust want to give move background. I have a Tonnage Data Table with 2 columnsTonnage Capacity - Tonnage Data Table'[Tonnage Capacity] and Tonnage Vessel Name - Tonnage Data Table'[Tonnage Vessel Name]
- AnonymousNot applicable
Hello
- AnonymousNot applicable
Hi Anonymous
I am not very sure what you want to achieve...your table only has 2 columns, and you want to select a Vessel Name in a slicer? to return an avg on Capacity of the same table? I saw there is another table Trips Data Table, what is in there? what is the relationship between these two tables?
- AnonymousNot applicable
Hello Anonymous
I am using Power Pivot in excel for my final analysis
Yes, I have 2 set of excel workbooks, Trips data table(Contains columns like Tonnage , Revenue) and Tonnage data table Contains columns like Vessel name and Tonnage Capacity
I need to create a measure which will give me the tonnage capacity of every vessel when I drop the same in power pivot. However I am unable to create such measure.
- AnonymousNot applicable
I need to create a measure which will give me the tonnage capacity of every vessel when I drop the same in power pivot. However I am unable to create such measure. When I am using the measures I have created in Power Pivot, I get the average of the entite column instead of corresponding tonnage capacity against each vessel name on dropping the measure in values section
- AnonymousNot applicable
Hi Anonymous
I can't get what is the relationship between your tables, and how your results came out like the screenshot. Can you provide a sample file? Will pm you my email address.
- AnonymousNot applicable
Hi Anonymous ,
Quick summarization:
Or create a measure:
average measure = CALCULATE(AVERAGE('Tonnage Data Table'[TONNAGE CAP]),ALLEXCEPT('Tonnage Data Table','Tonnage Data Table'[Tonnage Vessel Name]))
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - AnonymousNot applicable
Hi Anonymous ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Best Regards,
Eyelyn Qin- AnonymousNot applicable
Hi Anonymous
It was solved, Anonymous sent me files. It was an Excel connected to PBI dataset, using fact table column to retrieve data from dim table.