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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.