Forum Discussion
Anonymous
3 years agoNot applicable
New coustmer count
"Firstly i explain about my data i have data till 2016 to today table -cube target this is my data table here sold to partner code is dealer and invoice quantity is sale my date start from 2016 ...
- 3 years ago
The below measure assumes that there is a relationship from your calendar table to the fact table
Num new dealers = VAR EndDate = EOMONTH ( MAX ( 'Calendar'[Date] ), -1 ) VAR PrevDealers = CALCULATETABLE ( VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] ), REMOVEFILTERS ( 'Calendar' ), 'Calendar'[Date] <= EndDate ) VAR CurrentDealers = VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] ) RETURN COUNTROWS ( EXCEPT ( CurrentDealers, PrevDealers ) )
johnt75
Super User
3 years agoThe below measure assumes that there is a relationship from your calendar table to the fact table
Num new dealers =
VAR EndDate =
EOMONTH ( MAX ( 'Calendar'[Date] ), -1 )
VAR PrevDealers =
CALCULATETABLE (
VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] ),
REMOVEFILTERS ( 'Calendar' ),
'Calendar'[Date] <= EndDate
)
VAR CurrentDealers =
VALUES ( 'CUBE_TARGET'[D_PARTNER_PARTNER_CODE] )
RETURN
COUNTROWS ( EXCEPT ( CurrentDealers, PrevDealers ) )