Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

churn

Hi Guys,

 

Thanks for your continued support. 

 

I have encountered a problem idendifying customers who have bought our subscriptions in one year but not another.

 

Below is a low level example of my problem.

 

customer IDSubscription ID Year of Subscription
ABC11232015
xyz11232016
mnc11232017
dcs11232015
hjg11232019

 

  1.  I want to identify customers who have purchased a subscription in 2016 and 2017 but not 2018.
  2. I want to identify customers who have purchased a subscription in 2016 and 2018 but not 2017.
  3. I want to identify customers who have purchased a subscription in 2017 and 2018 but not 2019.

I have searched online and watched several YouTube videos but haven't been able to solve the problem.

 

I would appreciate any help any of you kind people could give me. =]

 

Brendan

3 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @AlB,

 

Thats some sweet DAX code thank you for the prompt reply. Having some issues though. Anything you could do with the following

 

 

ListCustomers1 =
VAR T2017 = CALCULATETABLE ( VALUES (Renewals[Account_ID]), Renewals[Renewal Year] = 2017 ) VAR T2018 = CALCULATETABLE ( VALUES ( Renewals[Account_ID]), Renewals[Renewal Year] = 2018 ) RETURN (EXCEPT ( T2017, T2018 ))
 
Error
 
Calculation error in measure "Renewals"[ListCustomers1]: A table of multiple values was supplied where a single value was expected.
 
Thanks for your help =]

 

View solution in original post

AlB
Community Champion
Community Champion

Hi @Anonymous

 

You are trying to squeeze that code into a measure, which does not allow multiple values.

The code generates a one-column table, as I said. Use the "New Table" button under "Modelling" to create a new table and then add the code to define it. You'll see a one-column table with the list of names. 

You can then place a table visual (or matrix) in your report and place  'Acount ID' in rows.  'Acount ID' is the only column in the generated table, ListCustomers1. 

 

Does that help?    

View solution in original post

AlB
Community Champion
Community Champion

@Anonymous

cool. glad to hear. how about some kudos then? Smiley Wink

View solution in original post

8 REPLIES 8
AlB
Community Champion
Community Champion

Hi @Anonymous

How about something like this for your requirement number 1. It's a one-column table:

 

ListCustomers1=
VAR T2016 = CALCULATETABLE ( VALUES ( Table1[Customer ID] ); Table1[Year of Subscription] = 2016 ) VAR T2017 = CALCULATETABLE ( VALUES ( Table1[Customer ID] ); Table1[Year of Subscription] = 2017 ) VAR T2018 = CALCULATETABLE ( VALUES ( Table1[Customer ID] ); Table1[Year of Subscription] = 2018 ) RETURN EXCEPT ( INTERSECT ( T2016; T2017 ); T2018 )

You can follow the same pattern for the others. Add the filter for the Subscription ID if you need to. 

It could be done with slicers to dynamically determine the years rather than hard-coding them but it gets trickier.

Anonymous
Not applicable

Hi @AlB,

 

Thats some sweet DAX code thank you for the prompt reply. Having some issues though. Anything you could do with the following

 

 

ListCustomers1 =
VAR T2017 = CALCULATETABLE ( VALUES (Renewals[Account_ID]), Renewals[Renewal Year] = 2017 ) VAR T2018 = CALCULATETABLE ( VALUES ( Renewals[Account_ID]), Renewals[Renewal Year] = 2018 ) RETURN (EXCEPT ( T2017, T2018 ))
 
Error
 
Calculation error in measure "Renewals"[ListCustomers1]: A table of multiple values was supplied where a single value was expected.
 
Thanks for your help =]

 

AlB
Community Champion
Community Champion

Hi @Anonymous

 

You are trying to squeeze that code into a measure, which does not allow multiple values.

The code generates a one-column table, as I said. Use the "New Table" button under "Modelling" to create a new table and then add the code to define it. You'll see a one-column table with the list of names. 

You can then place a table visual (or matrix) in your report and place  'Acount ID' in rows.  'Acount ID' is the only column in the generated table, ListCustomers1. 

 

Does that help?    

Anonymous
Not applicable

Hi @AlB,

 

I'm out of the office now, but yeah that makes sense. My colleague and I were trawling through all of the online documentation with no success. I'll put it down to it being Friday. =]

 

  Thank you so much for your help.

AlB
Community Champion
Community Champion

@Anonymous

My pleasure

Anonymous
Not applicable

It worked thank you so much

AlB
Community Champion
Community Champion

@Anonymous

cool. glad to hear. how about some kudos then? Smiley Wink

Anonymous
Not applicable

Sorry mate clearlty a noob. Gave you as much kudos as I could there.

 

Thanks again. =]

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors