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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hey,
I wrote SQL script but I want it also in Power BI.
The SQL is
Select Distinct DocNr, Salary
FROM DocPosition
JOIN Document ON DocPosition.PosNr = Document.DocNr
WHERE DocDate Between '01.04.2022' and '30.04.2022' and DocPosition.Nr = 4300 and DocArt =3
My idea is:
Solved! Go to Solution.
Hi @azaterol
Thanks for reaching out to us.
>> to transport it to DAX language
You can try this,
Table =
var _t1= SELECTCOLUMNS(FILTER(Table_1,Table_1[Nr]=4300),"PosNr",[PosNr])
var _t2= SELECTCOLUMNS(FILTER(Table_2,Table_2[DocDate]<=DATE(2022,4,30) && Table_2[DocDate]>=DATE(2022,4,1) && Table_2[DocArt]=3 && Table_2[DocNr] in _t1),"DocNr",[DocNr],"Salary",[Salary])
return _t2
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @azaterol
Thanks for reaching out to us.
>> to transport it to DAX language
You can try this,
Table =
var _t1= SELECTCOLUMNS(FILTER(Table_1,Table_1[Nr]=4300),"PosNr",[PosNr])
var _t2= SELECTCOLUMNS(FILTER(Table_2,Table_2[DocDate]<=DATE(2022,4,30) && Table_2[DocDate]>=DATE(2022,4,1) && Table_2[DocArt]=3 && Table_2[DocNr] in _t1),"DocNr",[DocNr],"Salary",[Salary])
return _t2
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@azaterol , In power bi You will take Document[DocNr] as unsummarized measure and you can use a measure
SUM(Document[Salary])
Filter can used using filter of slicer or you can use measure filter
example
calculate(SUM(Document[Salary]), filter(Document, DocDate >= date(2022,04,01) && DocDate < = date(2022,04,30) && [DocPosition.Nr] = 4300 && [DocArt] =3 ))
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.