DAX Counting Frequency Across Rows

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!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top