Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi there,
I`m struggling with the measure dateAdd which delivers NaN, which I don´t understand.
The value in the table which I am searching for looks like this:
The measure which I am using is
Actually, my understanding was that at least 0 should be returned. There is no calculation or division through zero, so why NaN?
In case of the dateAdd function: which key is used to do a lookup? Do I need an extra mapping to a calendar table?
Thanks in advance for any feedback.
Solved! Go to Solution.
@Heidilein , if there is only price and valueprevmonth, there is no way of distinction. For each product the valueprevMonth will be different. If delivery name is added to table visual, the measure will look like this
@Heidilein , If [price] is a column, then try changing the dax to
ValuePrevMonth = (CALCULATE(sum('Table'[Price]), DATEADD('Table'[Date],-1, MONTH)))
Thank you
Thanks, but price is already a measure with sum(table[price]), my fault, I should have added this as information.
@ChiragGarg2512 The data type of the column is already from kind date. I´m wondering if I need an index or sth like that?
@Heidilein , can some sample data for 10 to 12 rows be provided in tabular form. There shouldn't be a need to create a new column.
@ChiragGarg2512 I think I have found the problem. This is the table how it looks like.
Article | Price | Delivery | Date |
4251203005 | 23,04 € | Express GmbH TEST | 01.07.2023 |
4251203005 | 23,05 € | Express GmbH TEST | 01.11.2023 |
4251203005 | 23,06 € | Express GmbH | 01.09.2023 |
4251203005 | 23,07 € | Express GmbH | 01.10.2023 |
4251203005 | 23,08 € | Express GmbH TEST | 01.08.2023 |
I assume the measure cannot find the entry due to the change of the name of the delivery, right? Therefore dateAdd returns NaN because there is no such entry even the date is set.
@Heidilein , if there is only price and valueprevmonth, there is no way of distinction. For each product the valueprevMonth will be different. If delivery name is added to table visual, the measure will look like this
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 | |
4 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
8 | |
8 | |
8 |