Forum Discussion
count basis date
- 1 year ago
For that you couldn't rely just on relationships, as only one can be active at a time. You would need something like
Billed and Expired = VAR VisibleDates = VALUES ( 'Date'[Date] ) VAR Result = CALCULATE ( COUNTROWS ( 'Table' ), TREATAS ( VisibleDates, 'Table'[Expiry Date] ), TREATAS ( VisibleDates, 'Table'[Billing Date] ) ) RETURN Result
Try
Num expirations =
CALCULATE (
COUNTROWS ( 'Table' ),
USERELATIONSHIP ( 'Date'[Date], 'Table'[Expiration Date] )
)
Looks good...but what if I need the count of items that were billed and expired in the same month as the calender date table....
- johnt751 year agoSuper User
For that you couldn't rely just on relationships, as only one can be active at a time. You would need something like
Billed and Expired = VAR VisibleDates = VALUES ( 'Date'[Date] ) VAR Result = CALCULATE ( COUNTROWS ( 'Table' ), TREATAS ( VisibleDates, 'Table'[Expiry Date] ), TREATAS ( VisibleDates, 'Table'[Billing Date] ) ) RETURN Result- sandeep_sharma1 year agoHelper II
Thanks johnt75
It worked but I had to use userrelationship to link it with expiration date....the data is showing correct in that case only...otherwise not sure how it is showing very very less numbers...anyways...this is a great help..thanks....got to learn a new thing today 🙂
- sandeep_sharma1 year agoHelper II
though I have another condition I got stuck on....what if I need the count of items which got billed as the visiable date but got expired 2 months ago of visible dates