Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
 
					
				
		
Hello Experts,
I have a report table with :
- Multiple Report periods with same values (one by reseller active contract over period): 01/01/2021,01/12/2021,01/11/2021 ....
- Those resellers can have multiple contracts with the same reference for the same period.
I must retrieve the distinct lost contracts from previous periods ( month -1, month -2 ...)
I have tried comparing two results with except but i don't know why this is not working as it doesn't return correcly my reseller ref.
Attrition M = 
var _Q = SELECTEDVALUE(Revenue[Period])
var _Q_1 = DATEADD(Revenue[Period],-1,MONTH)
var _Resellers = CALCULATETABLE(DISTINCT(Revenue[Reseller Ref]),
                    FILTER (ALL(Revenue[Period]),
                    Revenue[Period] = _Q))
var _Old_resellers = CALCULATETABLE(DISTINCT(Revenue[Reseller Ref]),
                     FILTER (ALL(Revenue[Period]),
                      Revenue[Period] = _Q_1))
RETURN
COUNTROWS(
    EXCEPT(_Old_resellers,_Resellers)
)I give you a sample with my queries in attachment:
powerbi_sample 
Regards.
 
					
				
		
Thank you for your reply @amitchandak  I am really lost !
In fact it seems the same problem than my other request:
MTD = 
var _Q = SELECTEDVALUE(Revenue[Period])
var _Resellers = CALCULATETABLE(DISTINCT(Revenue[Reseller Ref]),
                    FILTER (ALL(Revenue[Period]),
                    Revenue[Period] = _Q))
RETURN
COUNTROWS(_Resellers)
LMTD = 
var _Q_1 = DATEADD(Revenue[Period],-1,MONTH)
var _Old_resellers = CALCULATETABLE(DISTINCT(Revenue[Reseller Ref]),
                     FILTER (ALL(Revenue[Period]),
                     Revenue[Period] = _Q_1))
RETURN
COUNTROWS(_Old_resellers)
Lost MTD = SUMX(VALUES(Revenue[Reseller Ref]),if(ISBLANK([MTD]) && not(ISBLANK([LMTD])) , 1,BLANK()))
New MTD = SUMX(VALUES(Revenue[Reseller Ref]),if(ISBLANK([LMTD]) && not(ISBLANK([MTD])) , 1,BLANK()))
I retrieve 0 values for LOST MTD. It seems related to SELECTEDVALUE segment:
Which retrieve multiple values from my report:
@Anonymous , refer if this approach of using isblank can help
Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | 
| User | Count | 
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 10 | |
| 9 |