Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hello All,
Can you please help me to write SQL query in DAX please. Below is the query
select count(*) from(
SELECT * FROM A WHERE ABTypeID
IN (10,11,12,13) and
BAID IN
(SELECT BAID FROM AB WHERE
CAID IN
(select CAID from ABC)))
Thanks!!
Hi @sunny27,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
Hi @sunny27,
It could be like below. But it depends on the data model structure. If you want a precise one, please provide a sample.
Measure =
VAR baids =
CALCULATETABLE ( VALUES ( ab[baid] ), ab[caid] IN VALUES ( abc[caid] ) )
RETURN
CALCULATE (
COUNTROWS ( a ),
a[abtypeid] IN { 10, 11, 12, 13 }
&& a[baid] IN baids
)
Best Regards,
Dale
You will need this add in tool from now on if you are building a lot of DAX queries in Excel for PowerPivot and Tabular.
Go To this link:
http://daxstudio.org/downloads/
Select the most current, first, download.
You can just run it after the download as a standalone app or open Excel and run it under Add In.
DaxStudio has everything you need.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 25 | |
| 22 | |
| 22 | |
| 19 | |
| 13 |
| User | Count |
|---|---|
| 68 | |
| 55 | |
| 44 | |
| 42 | |
| 30 |