Forum Discussion
Intersection Problem
- Anonymous7 years ago
for Intersection, i guess this below measure also helpful:
IF (ISBLANK (CALCULATE(COUNTROWS (FILTER (SUMMARIZE (Cust_table,Cust_table[CUST_CODE],"ProductsBought", DISTINCTCOUNT ( Sales[SKU])),[ProductsBought] = COUNTROWS ( VALUES ( Sales[SKU] ) ))))),0,CALCULATE(COUNTROWS (FILTER (SUMMARIZE (Cust_table,Cust_table[CUST_CODE],"ProductsBought",DISTINCTCOUNT ( Sales[SKU])),[ProductsBought] = COUNTROWS ( VALUES ( Sales[SKU] ) )))))
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] ) )
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
- Anonymous7 years agoNot applicable
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!
- Mariusz7 years ago
Community Champion
Hi Anonymous
Please see the below.
Measure 3 = MINX( 'Table', CALCULATE( COUNTROWS( 'Table' ), ALLSELECTED( 'Table'[CustomerName] ) ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.- Anonymous7 years agoNot applicable
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!
- Anonymous7 years agoNot applicable
Hi,
You Measure is not working in my environment:
ListOfCustomers =VAR _products = ALLSELECTED( SALESDATA_CASE1[ITEM_CODE])VAR _names =ADDCOLUMNS(VALUES( SALESDATA_CASE1[CustCode_CaseOne] ),"xxxx", CALCULATE( COUNTROWS( SALESDATA_CASE1 ), _products ))RETURN COUNTROWS( FILTER( _names, COUNTROWS( _products ) = [xxxx] ) )I m getting blank values, though actual value isnt blank. I m using Page level filtersAny more information you required to help me on this?Thanks in Advance!