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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.