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.
Hi all,
I am trying to calculate like SQL query using dax function.
SELECT COUNT(*) FROM TABLE
WHERE ID IN (SELECT ID FROM TABLE WHERE TYPE = 'ISSUE')
AND TYPE = 'USE';
Can anyone teach me how to use dax function and filter from below table?
Thank you in advance.
Solved! Go to Solution.
@Anonymous , Try like
measure =
var _tab = summarize(filter(allselected(Table),Table[TYPE] = "ISSUE"), Table[ID])
return
countrows(filter(Table,Table[TYPE] = "USE" && Table[ID] in _tab))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@Anonymous , Create a measure like
measure =
var _tab = summarize(filter(Table,Table[TYPE] = "ISSUE"), Table[ID])
return
countrows(filter(Table,Table[TYPE] = "USE" && Table[ID] in _tab))
Thank you for your answer.
I tried the way you told me.
But I don't know why "2022-01-02", "2022-01-03" doesn't come out of the results like below.
@Anonymous , Try like
measure =
var _tab = summarize(filter(allselected(Table),Table[TYPE] = "ISSUE"), Table[ID])
return
countrows(filter(Table,Table[TYPE] = "USE" && Table[ID] in _tab))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Thank you so much!!!
I solved it with the answer:)