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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
pityman
Regular Visitor

Join Table Dax Command

Hi,

How do i convert below sql to Dax?

Select COUNT(*) from ADStatus ADS , ADLink ADL

where

ADS.TDId = ADL.TDID AND ADS.ToStatus = '7' AND ADL.StatusId != 12

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @pityman

First create a new table as below:

Table = CROSSJOIN('ADL','ADS')

Then create a measure as below:

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[TDID]='Table'[TDId2]&&'Table'[StatusId]<>12&&'Table'[ToStatus]=7))

For the related sample .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @pityman

First create a new table as below:

Table = CROSSJOIN('ADL','ADS')

Then create a measure as below:

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[TDID]='Table'[TDId2]&&'Table'[StatusId]<>12&&'Table'[ToStatus]=7))

For the related sample .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

edhans
Community Champion
Community Champion

You don't. DAX isn't SQL. DAX doesn't have joins, it has filter relationships. If you want to join data, do it in Power Query using a merge. Otherwise, please posts data and show us what you are trying to accomplish, but I am pretty sure DAX will not be the solution here. DAX is for analysis, not transformations.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.