Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have following measure:
I would like the result to be either 91 or 89.
Solved! Go to Solution.
@JustinDoh1 not sure what you are trying to achieve, when you add or subtract:
ForecastMonths = DATEDIFF(
FIRSTDATE ('Table'[Survey Date]),
LASTDATE ('Calendar'[Month Year]),
MONTH
) + 1 // or -1
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
ForecastMonths =
VAR Diff = DATEDIFF(
FIRSTDATE('Table'[Survey Date]),
LASTDATE('Calendar'[Month Year]),
MONTH
)
RETURN
IF(Diff >= 0, Diff - 1, Diff)
If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
@JustinDoh1 sure here it is, change the condition as per your needs
ForecastMonths =
VAR __Months =
DATEDIFF(
FIRSTDATE ('Table'[Survey Date]),
LASTDATE ('Calendar'[Month Year]),
MONTH
)
RETURN
IF ( __Months >= 0, __Months - 1, __Months )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@JustinDoh1 not sure what you are trying to achieve, when you add or subtract:
ForecastMonths = DATEDIFF(
FIRSTDATE ('Table'[Survey Date]),
LASTDATE ('Calendar'[Month Year]),
MONTH
) + 1 // or -1
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Thank you and sorry.
I guess I need to use -1.
Can I ask you one more question?
How can I wrap so that this condition only applies if value is 0 or greater than 0 so that there is no -1?
I guess I am trying to use IF statement for the result.. Thanks.
Hi @JustinDoh1 ,
You can use EDATE on the LASTDATE to achieve this:
https://learn.microsoft.com/en-us/dax/edate-function-dax
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 11 | |
| 9 | |
| 8 |