March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |