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 dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All
Now i like to hard code the April Amount. Can some one share with me how to modify the above expression , so that it will alway display April 2021 amount even during in June 2021.
My PBI file :-
https://www.dropbox.com/s/9dcps366sl3uwmv/PBT_V2021_400%20GL_TI.pbix?dl=0
Paul
Solved! Go to Solution.
Hi @admin11 ,
If you want your expression to always display April 2021, you could modify it as follows:
Current month - 0 PnL2 =
TOTALYTD (
( GL[AMOUNT] ),
'Date'[Date],
FILTER ( 'Date', EOMONTH ( [Date], 0 ) = EOMONTH ( DATE ( 2021, 04, 01 ), 0 ) )
)
And if it's Mar 2021,you could change DATE (2021,04,01) to DATE (2021,03,01);
if it's Feb 2021, change DATE (2021,04,01) to DATE (2021,02,01);
and so on…
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @admin11 ,
If you want your expression to always display April 2021, you could modify it as follows:
Current month - 0 PnL2 =
TOTALYTD (
( GL[AMOUNT] ),
'Date'[Date],
FILTER ( 'Date', EOMONTH ( [Date], 0 ) = EOMONTH ( DATE ( 2021, 04, 01 ), 0 ) )
)
And if it's Mar 2021,you could change DATE (2021,04,01) to DATE (2021,03,01);
if it's Feb 2021, change DATE (2021,04,01) to DATE (2021,02,01);
and so on…
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much for your help , not many people understand what i am trying to said.
@admin11 , Try like
Current month - 0 PnL =
Var _1 = if(month(today()) >4, month(today()) -4, month(today()) +9)
VAR _MIN =
EOMONTH ( TODAY (), (-1* _1) -1 ) + 1
VAR _MAX =
EOMONTH ( TODAY (), (-1* _1) )
RETURN
TOTALYTD (
( GL[AMOUNT] ),
'Date'[Date],
FILTER ( 'Date', AND ( 'Date'[Date] >= _MIN, 'Date'[Date] <= _MAX ) )
)
here +9 can be +8
it work fine , Thank you very much for your help.
May i know how to modify the expression for Mar 2021 ? i have try play with from -1 to -2 it does not work.
Paul Yeo
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 |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
88 | |
52 | |
45 | |
39 | |
38 |