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.
Hi, Can someone please help me, I need to write the following SQL in DAX
DATEADD(s,-1,DATEADD(mm,0,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)))
Thanks in advance
Solved! Go to Solution.
Hi @SuzieKidd ,
This is the correspondence between the sql function and the DAX function, please replace GETDATE() with today() or now().
Please refer to the following document for more information.
DATEADD function (DAX) - DAX | Microsoft Learn
DATEDIFF function (DAX) - DAX | Microsoft Learn
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SuzieKidd ,
This is the correspondence between the sql function and the DAX function, please replace GETDATE() with today() or now().
Please refer to the following document for more information.
DATEADD function (DAX) - DAX | Microsoft Learn
DATEDIFF function (DAX) - DAX | Microsoft Learn
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@SuzieKidd , We have Datediff also in DAX.
But dateadd requires continuous dates
In case you need to subtract day , just do [mm] - 7
else use date as date add
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.
User | Count |
---|---|
10 | |
6 | |
3 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
9 | |
8 | |
8 |