Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have a measure, which is a DateTime. I'm trying to subtract Years/Months/Days from this measure. But can't seem to find an easy way to do this.
Basically, I'm looking for a DateAdd function, but that accepts a single date instead of a column of date.
Example:
Measure: [FirstDate] = MIN(Table[Date])
FirstDate20DaysAdded = DateAdd([Firstdate],20,Days)
Hi! Could you resolve it? I want to do the same (Dateadd for a measure and not to a column)
I recommend that you put the exercise you want to find to be able to understand the dateadd what it does is Returns a table that contains a column of dates, shifted either forward or backward in time by the specified number of intervals from the dates in the current context.
Alright. What I eventually want to do is get the difference between that measure, and the current day. But in a text format, for example:
* 2 year(s), 3 month(s), 22 day(s).
* 3 month(s), 22 day(s).
* 22 day(s)
I've broken this up into several measures:
[FirstDate] = MIN(Table[Date])
[YearValue] = DATEDIFF([FirstDate],TODAY(),YEAR)
[YearValueText] = IF([YearValue] >= 1, CONCAT([YearValue]," year(s)"), "")
[MonthValue] = DATEDIFF(DATEADD([FirstDate],[YearValue],YEAR),TODAY(),MONTH)
This is where I need that DATEADD for a measure.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
56 | |
38 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |