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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
saanchi2804
Helper I
Helper I

YTD Change Calculated Column

Hi,

I have a table like below:

Current Balance  as_of_date  deal  Price  Value  
44412/14/22A703
567412/14/22A505
27912/14/22A608
..12/14/22B705
..12/14/22B603
..12/14/22B5010
..12/13/22A7020
..12/13/22A6090
..12/13/22A5040

 

I want to add a column YTD change such that for a particular deal, it is calculated as follows:-

 

YTD Change for Deal A for Price 70 = Filter the table for Deal A and Price 70 and then >> Value for Latest Date minus Value for 1st date of the year.

 

Similarly for Deal A for Price 50 = Filter the table for Deal A and Price 50 and then >> Value for Latest Date minus Value for 1st date of the year.

 

Need help with how to use DAX for this calculation

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi @saanchi2804 , try this:

 

- Create this calculate column:

Concat = Table_[deal  ]&Table_[Price  ]


- Create this another calculate column:

Result = var min_p=CALCULATE(MAX(Table_[Value  ]),ALLEXCEPT(Table_,Table_[Concat]))
return
min_p-Table_[Value  ]

The result:

Bifinity_75_0-1671283062963.png

 

 

Best Regards

 

 

 

 

View solution in original post

1 REPLY 1
Bifinity_75
Solution Sage
Solution Sage

Hi @saanchi2804 , try this:

 

- Create this calculate column:

Concat = Table_[deal  ]&Table_[Price  ]


- Create this another calculate column:

Result = var min_p=CALCULATE(MAX(Table_[Value  ]),ALLEXCEPT(Table_,Table_[Concat]))
return
min_p-Table_[Value  ]

The result:

Bifinity_75_0-1671283062963.png

 

 

Best Regards

 

 

 

 

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.