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

Be 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

Reply
conniedevina
Helper I
Helper I

Last YTD based on last date from data aupload

Hi All,

 

I have an issue regarding Last YTD, I have this sample data

conniedevina_1-1701940094811.png

I would like to achieve the total data 2022 till Aug.. because the current year data only available till August 2023.

I understand to use DatesYTD function but when I tried to use with flexible date somehow not working.

Below is the DAX I tried

m_LY FY = CALCULATE(SUM(Value), DATESYTD(dateadd('Date'[Date],-1,Year),FORMAT(MAX(Completions[Training Record Completed Date]),"MM/YY")))

Would appreciate any help provided! Thank you!

1 ACCEPTED SOLUTION

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1702005936492.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Bibiano_Geraldo
Community Champion
Community Champion

Try the following code, and see if is what you need

m_LY FY = 
CALCULATE(
    SUM(Value), 
    SAMEPERIODLASTYEAR(
        'Date'[Date]
        )
)
I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 

Hi @Bibiano_Geraldo 

Thanks for replying, I'm using the calculation but seems it's still showing me "Total all 2022"

conniedevina_0-1701999432060.png

While I am trying to achieve total 3774

 

as reference I put the pbix file here PBI File 

I would like to use "Date" Table to show the dates.

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1702005936492.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 


Thank you so much for the help, so I should create the "Date" Table following the Transaction table is it?

Thank you for help!

You are welcome.  Yes.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.