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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register 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
Resolver I
Resolver I

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

m_LY FY = 
CALCULATE(
    SUM(Value), 
    SAMEPERIODLASTYEAR(
        'Date'[Date]
        )
)

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.