Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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
Solved! Go to Solution.
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!
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!
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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingVote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |