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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ewu
Helper I
Helper I

Get value of Last Row within an unfixed range

To the experts: 

 

How could I go from the 1sts column raw data to get results of the 2nd and 3rd column? Thanks so much.

 

Eleanor

ewu_0-1722014597838.png

 

 

 

1 ACCEPTED SOLUTION
SachinNandanwar
Impactful Individual
Impactful Individual

If it helped then kindly marked it resolved.



Regards,
Sachin
Check out my Blog

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@ewu PBIX is attached below signature. You first want to add an Index to your table in Power Query Editor.

 

Group = 
    VAR __Values = { "A", "B", "C" }
    VAR __Current = [Raw Data]
    VAR __Result = 
        IF( 
            __Current IN __Values,
            __Current,
                VAR __Index = [Index]
                VAR __PrevIndex = MAXX( FILTER( 'Table', [Index] < __Index && [Raw Data] IN __Values ), [Index] )
                VAR __Result = MAXX( FILTER( 'Table', [Index] = __PrevIndex ), [Raw Data] )
            RETURN
                __Result
        )
RETURN
    __Result
Latest Date = 
    VAR __Group = [Group]
    VAR __Values = { "A", "B", "C" }
    VAR __Table = 
        ADDCOLUMNS(
            FILTER( 'Table', [Group] = __Group && NOT( [Raw Data] IN __Values ) ),
            "__Date", DATEVALUE( [Raw Data] )
        )
    VAR __Result = MAXX( __Table, [__Date] )
RETURN
    __Result

 



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Crazy! Thanks very much!

SachinNandanwar
Impactful Individual
Impactful Individual



Output =
CALCULATE (
    MAX ( 'Table'[Date] ),
    ALLEXCEPT (
        'Table',
        'Table'[Type]
    )
)


There is one less row for 'A' in my data

SachinNandanwar_0-1722015897199.png

 

 



Regards,
Sachin
Check out my Blog

Even crazier! 🙏🙏 

SachinNandanwar
Impactful Individual
Impactful Individual

If it helped then kindly marked it resolved.



Regards,
Sachin
Check out my Blog

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.