PowerBI DAX – How to do a subquery to the same column in the same table

Viewed 25

I have the following SQL-Statement which I need to transform to DAX-Statement. Unfortunately I'm not familiar with more "complex" DAX-Statements. Can somebody please help me with transforming this statement?

select count(distinct knd_nr)                                                            
from cm_calc  
where knd_nr in (select distinct knd_nr from cm_calc x where vertriebsweg = 'B2C Amazon' and order_count = 1)  
and knd_nr in (select distinct knd_nr from cm_calc x where vertriebsweg = 'B2C Endkunde Brutto'                                                                     
and order_count = (select max(order_count) from cm_calc y where x.knd_nr = y.knd_nr))
0 Answers
Related