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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
How I can calculate a previous date since a column with a data time received. Example: I have a column with this date:
I want to calculate a previous date, it would be 31/03/24
thank you
Solved! Go to Solution.
Hi, @AnaIsa
Thanks for @lbendlin reply. This is an additional step to his response, if you are confused how to proceed, you can refer to the following methods.
1. Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDRNzDUNzIwMlGKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"ChangedType" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
AddedCustom = Table.AddColumn(ChangedType, "Previous Day", each Date.AddDays([Date], -1), type date)
in
AddedCustom
2. Power BI Desktop
Previous Day 2 =
VAR _previousDate = CALCULATE(SELECTEDVALUE('Table'[Date]) - 1)
RETURN
_previousDate
Or use Dateadd function directly.
DATEADD - DAX Guide
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @AnaIsa
Thanks for @lbendlin reply. This is an additional step to his response, if you are confused how to proceed, you can refer to the following methods.
1. Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDRNzDUNzIwMlGKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
#"ChangedType" = Table.TransformColumnTypes(Source,{{"Date", type date}}),
AddedCustom = Table.AddColumn(ChangedType, "Previous Day", each Date.AddDays([Date], -1), type date)
in
AddedCustom
2. Power BI Desktop
Previous Day 2 =
VAR _previousDate = CALCULATE(SELECTEDVALUE('Table'[Date]) - 1)
RETURN
_previousDate
Or use Dateadd function directly.
DATEADD - DAX Guide
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
I would like to see the sales value for previous month at product detail, I only see it in a general table like this:
but if I want to see by detail, If I select a month I see the same amount for AC and AC-1, the formula used for AC-1 is:
could you help me please ?
In Power Query you subtract #duration(1,0,0,0) . In DAX you subtract 1.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 81 | |
| 69 | |
| 50 | |
| 46 |