PivotTable from DateTable + ContractTable

OlaSa

New Member
Joined
Mar 22, 2015
Messages
23
Hello,

This is my first post here.
I try to learn DAX and can't figure out how to Count the number of Active Contracts by Market.
Could anyone give me a hint ?

Kind regards,
Ola


3 tables (Contracts, Repairs, Dates):
1. Contracts contains ; ContractNo, StartDate, EndDate, Market
2. Repairs contains ; Date, ContractNo, RepairAmount
3. Dates contains only ; Date

2 joins:
Contracts[ContractNo] --> Repairs[ContractNo]
Repairs[Date] --> Dates[Date]


New column create; Dates[Active Contract]
=COUNTAX(FILTER(VALUES(Contracts), AND(Contracts[Start date]<=Dates[Date], Dates[Date]<=Contracts[End date])), Contracts[Contract No])
--> Active contract by Date
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome OlaSa,

try this:
=CALCULATE(COUNT(Contracts[Contract No]), FILTER(Contracts;[Date]<=Contracts[End date] && [Date]>=Contracts[Start date]))

Imke
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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