Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone,
I need some help with hopefully a basic issue!
I have Customer IDs (sales[Customer_ID]) and all the products that those customers purchased, as well as the brand of those products(sales[Brand]). There are only two brands I'm interested in looking at, so for the purposes of this, lets say the data in sales[Brand] only has "Brand 1" and "Brand 2".
I need to create a calculated column that checks the customer's ID, and checks if they have at any point in time purchased both Brand 1 and Brand 2. Doesn't have to be on the same date or anything. I just need the output to be "Yes" if both brands appear against any particular customer ID.
So for example results should be:
Customer ID | Brand | Date | New Calc column |
Joe-12345 | Brand 1 | 01/01/2018 | Yes |
Bob-6234 | Brand 1 | 06/07/2018 | No |
Joe-12345 | Brand 2 | 12/01/2018 | Yes |
Anne-7894 | Brand 2 | 20/07/2018 | No |
Anne-7894 | Brand 2 | 20/02/2018 | No |
Thank you for any assistance!
Solved! Go to Solution.
@Alenth file is attached.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
This calculated column formula works
=if(CALCULATE(DISTINCTCOUNT(Data[Brand]),FILTER(Data,Data[Customer ID]=EARLIER(Data[Customer ID])))>1,"Yes","No")
Hope this helps.
@Alenth try this calculated column
Both Brand = VAR __bothBrands = CALCULATE( DISTINCTCOUNT( Brand[Brand] ), ALLEXCEPT( Brand, Brand[Customer ID], Brand[Brand]), Brand[Brand] In {"Brand 1", "Brand 2" } ) RETURN IF( __bothBrands >= 2, "Yes", "No" )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Alenth file is attached.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Alenth glad I could help. Cheers!!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |