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
alearner
Helper I
Helper I

Find the NAV which is past 1 year from the latest NAV date

Need some suggestion. I have 2 tables:

1. Date Table which has all the dates

2. NAV table which has NAV for a Scheme for the past 1o years. The columns are as below:

     NAV_Date Scheme_Name NAV_Value

 

My requirement is that I would like to know what was the NAV 1 year from the lastest NAV in the NAV Table. 

 

The challange that I am facing is that if I substract 1 year to the lastest NAV that might be a Saturday or Sunday or a Holiday and I will not have a NAV_Value for that date.

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @alearner ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1701156976091.png

(2) We can create a calculated column.

Column = 
var _b=DATE(YEAR('NAV table'[navDate])-1,MONTH('NAV table'[navDate]),DAY('NAV table'[navDate]))
var _c=MinX(FILTER('NAV table',[navDate]>=_b),[navDate])
RETURN IF(not YEAR('NAV table'[navDate])-1 in VALUES('Date Table'[Date].[Year]),BLANK(),CALCULATE(SUM('NAV table'[navValue]),FILTER('NAV table','NAV table'[navDate]=_c)))

(3) Then the result is as follows.

vtangjiemsft_1-1701157383699.png

Best Regards,

Neeko Tang

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-tangjie-msft
Community Support
Community Support

Hi @alearner ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1701156976091.png

(2) We can create a calculated column.

Column = 
var _b=DATE(YEAR('NAV table'[navDate])-1,MONTH('NAV table'[navDate]),DAY('NAV table'[navDate]))
var _c=MinX(FILTER('NAV table',[navDate]>=_b),[navDate])
RETURN IF(not YEAR('NAV table'[navDate])-1 in VALUES('Date Table'[Date].[Year]),BLANK(),CALCULATE(SUM('NAV table'[navValue]),FILTER('NAV table','NAV table'[navDate]=_c)))

(3) Then the result is as follows.

vtangjiemsft_1-1701157383699.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

alearner
Helper I
Helper I

Please refer below for the sample file:

 

pastebin.com/embed_js/0EcLuH32?theme=dark 

 

The last row in the sample data is 

 

  1. 20-10-2023 250.429 250.429 HDFC Mutual Fund HDFC Large and Mid Cap Fund - Direct Plan - Growth

So the latest NAV date is 20-10-2023 for HDFC Large and Mid Cap Fund - Direct Plan - Growth scheme. I would like to know the NAV value for 20-10-2022. Since 20-10-2022 was a weekday I have a value but had it been a weekend I would not have a value so intead would lile to have the value for Monday or the next day which has a value. 

Fowmy
Super User
Super User

@alearner 

It will be helpful if you could provide some sample data and explain the expected results.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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!

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.