Forum Discussion

mh2587's avatar
mh2587
Super User
4 years ago

Week Count in XTable based on date range with Inactive relation of Date Table

I have two tables

1.Customer > Customer Name , Created Date

2.Date Table > Year , Month , Date , Week In Year
Now the scenario is: I want count the Week In Year(Date Table) But In the range of Created Date which is the column in Customer Table but the issue is the relation is inactive between customer and date table 

 

 

 

2 Replies

  • mh2587 , Try a measure  like

     

    =
    var _max = maxx(allselected(Customer),Table[Created Date])
    var _min = minx(allselected(Customer),Table[Created Date])
    return
    calculate( distinctcount(Date[Week In Year]), filter('Date', 'Date'[Date] <=_max && 'Date'[Date] >=_min))

    • mh2587's avatar
      mh2587
      Super User

      Thanks for the response but it's Not working