Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sbolton1855
Frequent Visitor

Create table from SQL in DAX

How can I use this SQL to create a DAX table?

 

 

select distinct deviceid

from point.tm_assets

where companyid in (select distinct companyid from point.z_company_subscribed_base where applicationname = 'Specific Application')

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sbolton1855 ,

 

Create a calculated table like below:

Table = 
var tmp = CALCULATETABLE(DISTINCT('point z_company_subscribed_base'[companyid]),FILTER('point z_company_subscribed_base','point z_company_subscribed_base'[applicationname]="Specific Application"))
return
CALCULATETABLE(DISTINCT('point tm_assets'[deviceid]),FILTER('point tm_assets','point tm_assets'[deviceid] in tmp))

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sbolton1855 ,

 

Create a calculated table like below:

Table = 
var tmp = CALCULATETABLE(DISTINCT('point z_company_subscribed_base'[companyid]),FILTER('point z_company_subscribed_base','point z_company_subscribed_base'[applicationname]="Specific Application"))
return
CALCULATETABLE(DISTINCT('point tm_assets'[deviceid]),FILTER('point tm_assets','point tm_assets'[deviceid] in tmp))

 

Best Regards,

Jay

amitchandak
Super User
Super User

@sbolton1855 , Calculated Table in DAX

 

summarize(filter(tm_assets, tm_assets[companyid] in summarize(filter(z_company_subscribed_base, z_company_subscribed_base[applicationname] = "Specific Application"),[companyid])), tm_assets[deviceid])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.