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
Solle
Helper III
Helper III

WTD, MTD, QTD and YTD calculation on aggregated data

Hi 🙂 

I am currently working with some data, which is aggregated in that sense, that it is a snapshot that is taken each day which is the total. 

I.e. I have the following table which does only include business days - I am using a datetable for that named DimDate

DateGroupMarket Value
08/03/2023Net Asset Value100
09/03/2023Net Asset Value102
10/03/2023Net Asset Value103
13/03/2023Net Asset Value101


I have tried using the built-in functionalities like TotalYTD etc. but they sums it all up providing me with a very large number. 

Based on the above table I would like the YTD to be 101 - 100 = 1

Does anyone know how to solve this? Please let me know if anything else is required from my side to sort this. 

Best Regards,
Solle

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Solle See this: Better Year to Date Total - Microsoft Power BI Community

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Solle See this: Better Year to Date Total - Microsoft Power BI Community

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 
Thank you for your input, the video and in particular your very fullfilled work on the time intelligence functions helped me to come up with a solution as per below:

Solvency Summary - Solvency YTD =
VAR CurrentYear =
    YEAR ( MAX ( 'FactSolvencySummary'[As Of Date] ) )
VAR CurrentValue =
    CALCULATE( MAX ( 'FactSolvencySummary'[Market Value inc Accrued Interest] ), FactSolvencySummary[Attribute] = "Solvency")
VAR MinDate =
    CALCULATE ( MIN ( 'FactSolvencySummary'[As Of Date] ), YEAR ( 'DimDate'[Date]) = CurrentYear )
VAR _minValue =
    CALCULATE ( MIN ( 'FactSolvencySummary'[Market Value inc Accrued Interest] ), FactSolvencySummary[Attribute] = "Solvency", 'DimDate'[Date] = MinDate )
VAR PrimoUltimoValue = CurrentValue - _minValue
RETURN
    PrimoUltimoValue

I will accept your response as a solution to this 🙂 

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.

Top Solution Authors