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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
TotunG
Resolver I
Resolver I

Getting YTD / YTG Values (Dynamic)

Hi,

 

My example data:

TotunG_3-1697622929739.png

 

I'm trying to use the TODAY() function to dynamically calculate YTD / YTG values using various measures:

Gets the Current Month Number (so 10 for October)

TotunG_0-1697622781802.png

Tries to Calculate the SUM of Values where month is less than or equal to 10 (curr. month)

TotunG_1-1697622815524.png

Manual Version (would have to be updated monthly):

TotunG_2-1697622902098.png

 

How can I make this work?

1 ACCEPTED SOLUTION
TotunG
Resolver I
Resolver I

2 REPLIES 2
bolfri
Super User
Super User

Hi,

 

you need to use FILTER() to make this work. Like this:

Total YTD Value =
CALCULATE (
    SUM ( 'A - Monthly Values'[Value] ),
    FILTER ( 'A - Monthly Values', 'A - Monthly Values'[Month] < [Current Month] )
)




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

Proud to be a Super User!




TotunG
Resolver I
Resolver I

SOLVED: 

 

TotunG_0-1697623459321.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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