ssas tabular - How to count orders with condition A and B in dax -


i have table order number , product code. 1 order can have multiple lines. count number of orders have both product code , product code b.

my table looks this:

ordernumber productcode order1      order1      b order2      b order3      order3      b order4      c

so result set, answer 2, both order1 , order3 contains both , b.

i create measure in dax.

thank you.

try this:

sumx(   calculatetable(    values(mytable[ordernumber]),     mytable[productcode] = "a"   ),   if(calculate(countrows(mytable),mytable[productcode] = "b") > 0,1) ) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -