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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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