Forum Discussion

J_4923's avatar
J_4923
Frequent Visitor
9 years ago
Solved

SQL to DAX

Hi,

 

I would like to create a calculated table but don't know how to translate below to DAX?

 

/****** Script for SelectTopNRows command from SSMS  ******/
select distinct * from (

SELECT distinct originCountry as country, originArea as area, OriginRegion as region,seaair as product, customerName as customer
  FROM tmp where ETDYear = 2017

  union all

 
SELECT distinct DestinationCountry as country, DestinationArea as area, DestinationRegion as region,seaair as product, customerName as customer
  FROM tmp where ETDYear = 2017

  union all

  SELECT distinct FreightPayerCountry as country, FreightPayerArea as area, FreightPayerRegion as region,seaair as product, customerName as customer
  FROM tmp where ETDYear = 2017 
  
    union all

  SELECT distinct CRMOwnerCountry as country, CRMOwnerArea as area, CRMOwnerRegion as region, customerName as customer
  FROM tmp where ETD = '2017-03-12' and BLNumber in ('0001748TPA','AAR0029009')

 
  ) as GEOCustomer where area != 'AGENT' order by customer

2 Replies