Forum Discussion

akmiller's avatar
akmiller
New Member
3 years ago
Solved

Counting dates that fall between date range in another table (M to M relationship)

I have a flag or measure REMCUT which shows if an open date from one table occurs between a date range in another table for the same account. My issue is that I would like to count the number of service orders that occur in a given month with the REMCUT flag but my bar chart goes blank when I add it. 

 

REMCUT = 
CALCULATE(COUNT(RemoteCutoff[BI_SO_NBR]), 
FILTER(RemoteCutoff,
RemoteCutoff[BI_ACCT] = SELECTEDVALUE(PPBilling[BI_ACCT])&&
RemoteCutoff[BI_OPEN_DT] >= SELECTEDVALUE(PPBilling[BI_BCH_DT])&&
RemoteCutoff[BI_OPEN_DT] <= SELECTEDVALUE(PPBilling[EndDate])&&
SELECTEDVALUE(PPBilling[BI_TRAN_ACTIVITY]) = "ADD"))

 

Below you can see the REMCUT flags 12 service orders for this account which occured between BI_BCH_DT and EndDate. In the table below that, service order 2676574 does not get flagged because it occurs outside of the range. 

 

How can I get the count of service orders to show by the month they were opened?

The two tables are joined on a many to many relationship between accounts if that matters. 

Below is a link to sample file

https://www.dropbox.com/s/odz4cw4dztov4nd/Page_Test.pbix?dl=0

 

Thank you for your help!

2 Replies