Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
CustomerName | Products |
Mayank | OCEG2 |
Mayank | BRT3 |
Lithia | BRT3 |
Lithia | JOG0 |
Lithia | JHOT8 |
Chrils | HGY7 |
Shantanu | JOG0 |
Jennifer | JOG0 |
Jennifer | OCEG2 |
Jennifer | JHOT8 |
Jennifer | BRT3 |
Jennifer | HGY7 |
HI, I'm not able to calculate the intersection in Power BI.
Problem- I have Customer name and Product name in one table as two different columns. If i click on customer name , lets say, mayank and jennifer (multiselect), then number of products should be visible which is common in both. In my example its should be 2 (as product OCEG2 and BRT3 are the product purchased by Mayank and jennifer both.
Plus i want to show the common product name also which is common in both.
Please help!
Thanks in advance
Solved! Go to Solution.
for Intersection, i guess this below measure also helpful:
Hi @Anonymous
Please try the below DAX expression.
Measure = VAR _names = ALLSELECTED( 'Table'[CustomerName] ) VAR _products = CALCULATE( COUNT( 'Table'[Products] ), _names ) RETURN IF( COUNTROWS( _names ) = _products, 1 )
I've also attached a file with the example in the use.
Hi,
I apologize for my mistake,
But i want to multiselect Product instead of Customer and see how many customer bought both Product (If two products selected in slicer).
Thanks!
Hi @Anonymous
Please try the below.
Measure 2 = VAR _products = ALLSELECTED( 'Table'[Products] ) VAR _names = ADDCOLUMNS( VALUES( 'Table'[CustomerName] ), "xxxx", CALCULATE( COUNTROWS( 'Table' ), _products ) ) RETURN COUNTROWS( FILTER( _names, COUNTROWS( _products ) = [xxxx] ) )
Hi,
You Measure is not working in my environment:
Hi,
This measure is working but it is not giving me what i m looking for.
If i am selecting product 'BRT3' and 'OCEG2' and put Measure2 (what you have created) in values and put Products in column as a matrix Report then it is showing me value of 2 in BRT3 and 2 in OCEG2 and 2 in Total also. The value 2 coming in Total is absolutely correct but BRT3 is bought by 3 customer, similarly OCEG2 is bought by 3 customers and i want to see values as 3 in both product column and 2 in total one.
Currently i m seeing this one:
BRT3 | OCEG2 | Total |
2 | 2 | 2 |
What i want is here:
BRT3 | OCEG2 | Total |
3 | 3 | 2 |
Thanks!
HI,
This DAX is working for me. But what if i want to filter out this DAX based on a Measure? (Lets say, i have a measure of average product sold and want to filter my DAX, given by you,based on that measure where average product sold is greater than 10)
Second thing is i'm still not able to get only customers name which bought both products. I'm getting all customer list: please refer below:
Thanks!
Hi @Anonymous
Please see the screenshot and explanation below.
Red frame matrix represents your previous requirement were you asked to count at the product level and total to including only Customers who bought all selected product, for that please use Measure 3.
Green frame table is Using Measure 2 where we are going back to the requirement where you wanted to see how many customers bought all selected products.
I'm sure that from the illustration you can see that this requirement are different.
HI,
My intersection problem is solved. Thank you so much.
But measure 2 is not working for rest of the product combination. Can you please re-check Measure2?
Thank you!
for Intersection, i guess this below measure also helpful:
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |