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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gopinath_iyer
Helper II
Helper II

YTD basis current month

Hi

 

I need to create YTD value but till current month only. like in the below table YTD should be 3263.7 as we are in June month and next month it should be 3807.65.

 

MonthAmount
Jan'22543.95
Feb'22543.95
Mar'22543.95
Apr'22543.95
May'22543.95
Jun'22543.95
Jul'22543.95
Aug'22543.95
Sep'22543.95
Oct'22543.95
Nov'22543.95
Dec'22543.95
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Gopinath_iyer 

 

In your case, it would be better to need a date column.

vzhangti_1-1656400142208.png

YTD =
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER ( ALL ( 'Table' ), MONTH ( [Date] ) <= MONTH ( TODAY () ) )
)

vzhangti_2-1656400207648.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Gopinath_iyer 

 

In your case, it would be better to need a date column.

vzhangti_1-1656400142208.png

YTD =
CALCULATE (
    SUM ( 'Table'[Amount] ),
    FILTER ( ALL ( 'Table' ), MONTH ( [Date] ) <= MONTH ( TODAY () ) )
)

vzhangti_2-1656400207648.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

VahidDM
Super User
Super User

Hi @Gopinath_iyer 

 

If there is no Date table and your Month column is a date column, you can use the below DAX:

YTD = CALCULATE(SUM('Table'[Amount]),'Table'[Date or Month]<=TODAY())
If your Month Column is not a date column, you need to add a date column to your table and use that in the formula.
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Seanan
Solution Supplier
Solution Supplier

Hi @Gopinath_iyer 

 

You can create a measure to calculate this using the following code. Just replace the 'Table (4)'[Amount] with your own values

CurrentYTD = TOTALYTD(SUM('Table (4)'[Amount]),'Table (4)'[Dates], 'Table (4)'[Dates] < TODAY())

 

If this helps solve your issue please could you accept this as the solution.

Kind regards,

Seanan

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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