Need DAX formula for PowerPivot


New member
Dec 28, 2012
Reaction score
Hi All,

I am new to this forum.
Need a small help regarding building DAX formula for PowerPivot.
I have two tables in one sheet in excel. One is City and State data with Promotion Start Date and End Date.
The second one is just a list of days with date, month name and year for 2009 and 2010.

I want to match first table with second to create a Power Pivot which should be as follows:

1. Row Heading should contain State from first table
2. Column Heading should contain Year and month from second table.
3. Values should be populated with count of state against each month.

I have prepared a sample output table manually. Please refer to screenshots below for both input tables and desired output sheet.

First Table.png Second Table.png

I know and can achieve row heading and column heading sections easily but unable to build a DAX measure to populate value section.
Request you to please help build this formula. Looking for a quick response and would appreciate your effort on this.

Note: Also attaching the excel file for your reference that am working on.

Thanks in advance
Md Sarfaraz


  • Data for PowerPivot.xlsx
    269.9 KB · Views: 35