The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:)