I am confused with pivot tables, and it's a recurring issue! Say I have put 2 tables in my data model (classes and students):
My model is this one:
I want to build this simple pivot table, displaying under classname, student name (no sum or number, just plain values) like so.
If I do it like that, as proposed by @Cpt.Whale :
I get all students under each class like in a cartesian product. I just want to get the students who are associated with the class. If student fname were in class table, I simply would do a hierarchy. I want to do the equivalent of the hierarchy with the 2 tables. It might be obvious, but I cannot do it!
Update
I tried again and found a way to do it using RELATED()
DAX function in a calculated column :
I this case, the solution proposed by @Cpt.Whale indeed works correctly :
Is there a better and simpler way without using a calculated column, directly in Pivot Table, with kind of an implicit RELATED funtion ?
Sorry for all screenshots being in French Excel.
fname
to the Rows (Lignes) section and place it underclassname
. Does that give you the view you want?RELATED()
DAX function (see my update), but I guess there would be a better way.count of classname
or your calculated column, but never(?) when using foreign columns. Maybe buggy behavior with the internal olap connections? I'm not sure...