Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
So I was comparing the current value (Opportunity) and the value 3 months prior (PrevQuarterOPP) using the dateadd function but its not getting the correct value or should I say its not capturing the value. See screenshot below
When I checked the data source. I found out that Decision Period column changed inputs for the 2 months i'm comparing. The Decision Period changed from PD12 FY23 to PD6 FY24
Current Filter - Updated Month (January 2023)
Year - FY23, FY24
I wanted to display the value even if the Decision Period Change
Hi @nolan0716 ,
You can try code as below to create a measure.
PreviousQuarterOPP =
VAR _SELECTDATE =
MIN ( 'TableName'[Updated Month] )
VAR _RangeStart =
EOMONTH ( _SELECTDATE, -4 ) + 1
RETURN
CALCULATE (
SUM ( 'TableName'[Opportunity] ),
FILTER (
ALL ( 'TableName' ),
'TableName'[Updated Month] >= _RangeStart
&& 'TableName'[Updated Month] < _SELECTDATE
)
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
this is what I got from your code
@nolan0716 , dateadd need continuous dates, so in case you need to add days, just add it to date
[Date] + 10
For month or year you can use Date function
Date(Year([Date]), Month([Date])+2 , Day([Date]) )
Dateadd and its Alternate: https://www.youtube.com/watch?v=9qiRivlBv8w&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=66
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
62 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
83 | |
61 | |
45 | |
41 | |
39 |