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 need to make this formula dynamic based on today's date, any help?
Solved! Go to Solution.
@Giada90 , You can try this:-
Ricavi_BDG_FY 2 =
VAR _current_year =
YEAR ( TODAY () )
RETURN
IF (
AVERAGE ( Aggregato[FY] ) = _current_year,
CALCULATE (
[Ricavi_BDG],
DATESBETWEEN (
'Date'[Date],
DATE ( _current_year, 1, 1 ),
DATE ( _current_year, 12, 2 )
),
ALL ( 'Date'[Date] )
),
IF (
AVERAGE ( Aggregato[FY] ) = _current_year - 1,
CALCULATE (
[Ricavi_BDG],
DATESBETWEEN (
'Date'[Date],
DATE ( ( _current_year - 1 ), 1, 1 ),
DATE ( ( _current_year - 1 ), 12, 2 )
),
ALL ( 'Date'[Date] )
),
IF (
AVERAGE ( Aggregato[FY] ) = _current_year - 2,
CALCULATE (
[Ricavi_BDG],
DATESBETWEEN (
'Date'[Date],
DATE ( ( _current_year - 2 ), 1, 1 ),
DATE ( ( _current_year - 2 ), 12, 2 )
),
ALL ( 'Date'[Date] )
),
0
)
)
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
@Giada90 , You can try this:-
Ricavi_BDG_FY 2 =
VAR _current_year =
YEAR ( TODAY () )
RETURN
IF (
AVERAGE ( Aggregato[FY] ) = _current_year,
CALCULATE (
[Ricavi_BDG],
DATESBETWEEN (
'Date'[Date],
DATE ( _current_year, 1, 1 ),
DATE ( _current_year, 12, 2 )
),
ALL ( 'Date'[Date] )
),
IF (
AVERAGE ( Aggregato[FY] ) = _current_year - 1,
CALCULATE (
[Ricavi_BDG],
DATESBETWEEN (
'Date'[Date],
DATE ( ( _current_year - 1 ), 1, 1 ),
DATE ( ( _current_year - 1 ), 12, 2 )
),
ALL ( 'Date'[Date] )
),
IF (
AVERAGE ( Aggregato[FY] ) = _current_year - 2,
CALCULATE (
[Ricavi_BDG],
DATESBETWEEN (
'Date'[Date],
DATE ( ( _current_year - 2 ), 1, 1 ),
DATE ( ( _current_year - 2 ), 12, 2 )
),
ALL ( 'Date'[Date] )
),
0
)
)
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
thanks!
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 |
---|---|
81 | |
75 | |
60 | |
37 | |
33 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |