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
NumeritasMartin
Frequent Visitor

Max / Last date on a filtered range

Hi All,

 

Hopefully an easy question.

 

I have a data set where the value of a period is stored every subsequent period, where the period value is the same but the 'as at period' is monthly. The value to be referenced is the one represented in the latest 'as at period'.

 

In the below table I only want to bring back the two values highlighted in green.

 

Date Filter.png

 

1 ACCEPTED SOLUTION
NumeritasMartin
Frequent Visitor

I solved my issue.

I created a calculated column which concatenated the elements which would impact my filter, then using that column as a variable I filtered my table using MAXX on the As At date. 

 

So far the numbers reconcile.

View solution in original post

2 REPLIES 2
NumeritasMartin
Frequent Visitor

I solved my issue.

I created a calculated column which concatenated the elements which would impact my filter, then using that column as a variable I filtered my table using MAXX on the As At date. 

 

So far the numbers reconcile.

moizsherwani
Continued Contributor
Continued Contributor

I am sure there is a more efficient way to to do this so I will let the experts improve on my answer (note this is a calculated table you need to create)

 

AsAtPeriod =
SUMMARIZE (
    'Table',
    'Table'[Data Item],
    "MAXDATE",
        CALCULATE (
            MAX ( 'Table'[As of Date] ),
            ALLEXCEPT ( 'Table', 'Table'[Data Item] )
        ),
    "VAL",
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                'Table',
                'Table'[As of Date]
                    = CALCULATE (
                        MAX ( 'Table'[As of Date] ),
                        ALLEXCEPT ( 'Table', 'Table'[Data Item] )
                    )
            )
        )
)

 

 

moizsherwani_0-1632240352841.png

 

Regards,

 

Moiz

If this post helps, please "Accept" it as Solution to help other members find it.

 

 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

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.