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
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...


@ 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!:
The Definitive Guide to Power Query (M)

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...


@ 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!:
The Definitive Guide to Power Query (M)

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
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.

Top Solution Authors