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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Can anyone help me to convert below SQL into DAX?
"
SELECT *
FROM VW_PTP_NC_PHASE
WHERE VW_PTP_NC_PHASE[NC Number]
IN (SELECT VW_PTP_NC_PHASE[NC Number]
FROM VW_PTP_NC_PHASE
WHERE VW_PTP_NC_PHASE[Workflow Phase Name]="Closed") "
Thank you.
Solved! Go to Solution.
Hi there,
Here is how I would translate this to a DAX query:
EVALUATE
VAR NC_Number_Filter =
CALCULATETABLE (
VALUES ( W_PTP_NC_PHASE[NC Number] ),
VW_PTP_NC_PHASE[Workflow Phase Name] = "Closed"
)
RETURN
CALCULATETABLE ( VW_PTP_NC_PHASE, NC_Number_Filter )
Where are you intending to use this?
There may be other considerations depending on the context, but essentially the same code should work elsewhere, such as in a measure.
Regards
Dax format = FILTER( VW_PTP_NC_PHASE,
CONTAINS( VALUES(VW_PTP_NC_PHASE[NC Number]),
CALCULATETABLE( VALUES(VW_PTP_NC_PHASE[NC Number]), VW_PTP_NC_PHASE[Workflow Phase Name] = "Closed" ), VW_PTP_NC_PHASE[NC Number] )
)
Hi there,
Here is how I would translate this to a DAX query:
EVALUATE
VAR NC_Number_Filter =
CALCULATETABLE (
VALUES ( W_PTP_NC_PHASE[NC Number] ),
VW_PTP_NC_PHASE[Workflow Phase Name] = "Closed"
)
RETURN
CALCULATETABLE ( VW_PTP_NC_PHASE, NC_Number_Filter )
Where are you intending to use this?
There may be other considerations depending on the context, but essentially the same code should work elsewhere, such as in a measure.
Regards
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
18 | |
15 | |
7 | |
5 |