Forum Discussion
Intersection Issue in DAX
I' m getting values by selecting individual ProductCode but getting Blank values if i do Multiselect on ProductCode.
Can you suggest for this one?
Hi Anonymous
I am attaching the pbix file with your sample data
I get correct figures as you mentioned.
Please take a look and let me know
- Anonymous6 years agoNot applicable
Hi,
Still not working in my pbix file.
Momemt i multi-select itemcode, it gives me blank values. However it is working in yours. I m not able to understand .
Please suggest something??
- Zubair_Muhammad6 years agoCommunity Champion
Anonymous
You can share your file with me if you like.
Are you using some VISUAL or PAGE level filters?
- Anonymous6 years agoNot applicable
Hi,
Yes i m using multiple page level filters. Though following DAX is helping in case of Intersection.
But not able to filtered out on DAX Level.
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] ) )))))But this gives me result in general, following example will be easy to understand.I have 3 Items and suppose 100 customers bought each item. It means i have 300 Customers in total (item Wise).Now by using above DAX i m getting 50 Common Customer who bought all three (if i do multiselect on these 3 items).But i have a measure of Average quantity also. so if average quantity is greater than 10 then it will included in a list of Customers (what i get in begining is 300, but suppose i will get 250 only while applying this filter) and then only calculate Intersection (AND) dax over this filteres customers.I m not able to do this.Suppose:This is my sample Sales Data:Item Customer QTY Item1 cust1 4 Item1 cust2 56 Item1 cust3 78 Item2 cust3 3 Item2 cust4 30 Item2 cust2 40 Item2 cust5 67 Item3 cust3 40 Item3 cust2 34 What i m getting is count of 2 customers if i do multiselect on Item1 and Item2 and Item3.
But what i want to consider average quantity measure first (that means only consider those customer list where average quantity is greater than 10) which would be:
Item Customer QTY Item1 cust2 56 Item1 cust3 78 Item2 cust4 30 Item2 cust2 40 Item2 cust5 67 Item3 cust3 40 Item3 cust2 34 Now if i apply same DAX over here i will get output of 1 customer who bought item1 and Item2 and Item2, which is accurate
I do not want to apply filter after applying DAX of intersection, rather before doing so i prefer to identify customers based on measure.
Please help!