GiacTorrence
New Member
- Joined
- Dec 2, 2014
- Messages
- 40
Hi all,
I'm currently working with a fairly large data set, and am having some issues with devising a DAX formula that will count across rows once I pivot a column.
For example, in my powerpivot data model I have the columns:
ID Course Year
123 MAT101 2000
123 ENG101 2000
456 SCI-101 2001
456 BUS-12 2002
456 ENG-110 2003
In the data model I also have a "Headcount" measure.
So when I transpose the data in the pivot window and put the Year column into "COLUMNS", the ID into "ROWS" and Headcount into "VALUES", the data are then displayed as:
ID Course 2000 2001 2002 2003
123 MAT101 1
123 ENG101 1
456 SCI-101 1 (This should be in the 2001 column)
456 BUS-120 1 (This should be in the 2002 column)
456 ENG-110 1 (This should be in the 2003 column)
So what I'm looking to do is aggregate the values of 1 by ID, which would look like:
ID Count_By_ID
123 2
456 3
And then be able to pull in the courses if I want to drill into which 2 or 3 are attributed to each ID.
Hope this makes sense, and any help would be greatly appreciated, thanks!
I'm currently working with a fairly large data set, and am having some issues with devising a DAX formula that will count across rows once I pivot a column.
For example, in my powerpivot data model I have the columns:
ID Course Year
123 MAT101 2000
123 ENG101 2000
456 SCI-101 2001
456 BUS-12 2002
456 ENG-110 2003
In the data model I also have a "Headcount" measure.
So when I transpose the data in the pivot window and put the Year column into "COLUMNS", the ID into "ROWS" and Headcount into "VALUES", the data are then displayed as:
ID Course 2000 2001 2002 2003
123 MAT101 1
123 ENG101 1
456 SCI-101 1 (This should be in the 2001 column)
456 BUS-120 1 (This should be in the 2002 column)
456 ENG-110 1 (This should be in the 2003 column)
So what I'm looking to do is aggregate the values of 1 by ID, which would look like:
ID Count_By_ID
123 2
456 3
And then be able to pull in the courses if I want to drill into which 2 or 3 are attributed to each ID.
Hope this makes sense, and any help would be greatly appreciated, thanks!