Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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
Solved! Go to Solution.
You could use this query in Power BI desktop directly.
Besides, there are big difference between T-SQL query and DAX query. You'd better to learn DAX basics before you can convert T-SQL to DAX, here are some useful links for you reference.
https://support.office.com/en-us/article/QuickStart-Learn-DAX-Basics-in-30-Minutes-51744643-c2a5-436...
https://www.sqlbi.com/topics/from-sql-to-dax/
Regards,
Charlie Liao
You could use this query in Power BI desktop directly.
Besides, there are big difference between T-SQL query and DAX query. You'd better to learn DAX basics before you can convert T-SQL to DAX, here are some useful links for you reference.
https://support.office.com/en-us/article/QuickStart-Learn-DAX-Basics-in-30-Minutes-51744643-c2a5-436...
https://www.sqlbi.com/topics/from-sql-to-dax/
Regards,
Charlie Liao
Is there a reason you need this table as a calculated table using DAX?
It may be easier to use the Query Editor to import your tables (origin, destination, FreightPayer, and CRMOwner) as separate queries, rename the headers, then append into a single table.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 43 | |
| 37 | |
| 35 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 58 | |
| 29 | |
| 27 | |
| 25 |