Forum Discussion
Get an Latest date Records
- 1 year ago
Hi,
I tried to create a sample pbix file like below, and please check the below picture and the attached pbix file.
I used INDEX dax function in the measures.
INDEX function (DAX) - DAX | Microsoft Learn
Num expected result: = VAR _t = CALCULATETABLE ( SUMMARIZE ( 'fact', 'calendar'[Date] ), REMOVEFILTERS ( 'calendar'[Date] ) ) VAR _latestdate = INDEX ( 1, _t, ORDERBY ( 'calendar'[Date], DESC ) ) RETURN IF ( HASONEVALUE ( state[state] ), CALCULATE ( SUM ( 'fact'[num] ), KEEPFILTERS ( 'calendar'[Date] = _latestdate ) ) )Diff expected result: = VAR _t = CALCULATETABLE ( SUMMARIZE ( 'fact', 'calendar'[Date] ), REMOVEFILTERS ( 'calendar'[Date] ) ) VAR _latestdate = INDEX ( 1, _t, ORDERBY ( 'calendar'[Date], DESC ) ) RETURN IF ( HASONEVALUE ( state[state] ), CALCULATE ( SUM ( 'fact'[diff] ), KEEPFILTERS ( 'calendar'[Date] = _latestdate ) ) )
Hi Lakshmi123,
As we did not get a response, may I know if the above reply could clarify your issue, or could you please help confirm if we may help you with anything else?
And if the provided information meets your requirements, you can Accept the solution and also give Kudos on that reply. It helps other users who are searching for this same information and find the information.
Your understanding and patience will be appreciated.
Hi Lakshmi123,
I wanted to follow up on our previous suggestions regarding the issue. We would love to hear back from you to ensure we can assist you further.
If our response has addressed your query, please accept it as a solution and give a ‘Kudos’ so other members can easily find it. Please let us know if there’s anything else we can do to help.
Thank you.