Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
admin11
Memorable Member
Memorable Member

How to modify expression return Feb 2021 Amount ?

Hi All

 

I have below YTD expression working fine :-

 

_YTD EXP = CALCULATE(CALCULATE(GL[AMOUNT],DATESYTD('Date'[Date],"12/31")), GL[1_EXP] = "EXP")
 
Can some one help me to modify the above expression to return Feb 2021 amount .
 
 
admin11_0-1615807142797.png

 

 

 
My PBI file :-
 
Paul
10 REPLIES 10
mohammedadnant
Impactful Individual
Impactful Individual

Hi @admin11 

 

Good day,

 

Please check this video might help,  https://youtu.be/WiuXJGWwong

 

Thanks & Regards,

Mohammed Adnan

https://www.youtube.com/c/taik18

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

@mohammedadnant 

i Just finish watching the youtube.

I try to change the Y to M :-

 

_MTD EXP = CALCULATE(CALCULATE(GL[AMOUNT],DATESMTD('Date'[Date],"12/31")), GL[1_EXP] = "EXP")
 
I get error msg :-
admin11_1-1615809293089.png

 

HI @admin11 

Try this 2 formulas..

 

TOTALMTD(GL[AMOUNT], 'DATE'[DATE], ALL('DATE'[DATE]), GL[1_EXP] ="EXP")

 

TOTALYTD(GL[AMOUNT], 'DATE'[DATE], ALL('DATE'[DATE]), GL[1_EXP] ="EXP", "02/28")

 

Thanks & Regards,

Mohammed Adnan

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

@mohammedadnant 

 

Thank you for your sharing .

 

The first expression , i get error msg :-

 

Too many arguments were passed to the TOTALYTD function. The maximum argument count for the function is 4.

 

the second expression , i get error msg :-

 

Too many arguments were passed to the TOTALYTD function. The maximum argument count for the function is 4.

 

Paul Yeo

hi @admin11 

 

Can you share the pbix file..

 

Thanks & Regards,

Mohammed Adnan

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

Hi @admin11 ,

 

Your formula is used to calculate YTD. If you want to calculate the value of February, it is recommended that you apply filters to [amount].

V-lianl-msft_0-1615962877754.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@V-lianl-msft 

Thank you for sharing.

The reasons i need it with out using filter panel is because , i need it dynamic change every month with me change the filter panel setting. 

 

Paul

Hi @admin11 ,

 

Do you want to display the sum of the most recent months in the fact table with a card?

Try this measure:

Measure = var min_ = CALCULATE(MAX(GL[Posting Date]),ALLSELECTED('Date'))
var ym = FORMAT(min_,"YYYY-MM")
return CALCULATE(GL[AMOUNT],FILTER(GL,GL[1_EXP]="EXP"),FILTER('Date','Date'[YrMth Sort]=ym))

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@V-lianl-msft 

Thank you very much for your sharing. it work fine on the simple file , But when i try to test with my raw data , i notice that it does not work. it display blank , Hope you can take a look.

 

admin11_0-1616071253314.png

https://www.dropbox.com/s/9c0c1n12y12vbfp/PBT_V2021_381%20Sample%20Data%20ONLY%20ID%20GL%20get%20feb...

Above is my PBI file 

 

Paul

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.