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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
lazurens2
Frequent Visitor

Dax Measure to Specify which rows correspond to last change

Hello, 

 

I have this example please 

Expected output : a Measure that returns 1 for a = 3 / b = 6
These are verions and I need to specify which one is the last version

lazurens2_1-1663768350214.png

 

I tried this, the measure isn't even working because it couldn't find `_LastChange`

 

 

Best Score 2 = 
VAR _LastChange = SUMMARIZECOLUMNS('Table'[Column1],
"Maxd", Max('Table'[Column2])
)
VAR _group = VALUES('Table'[Column1])
VAR _max = _LastChange[Maxd]

Return 

VAR MaxValue =
    CALCULATE ( MAX ( 'Table'[Column2] ), REMOVEFILTERS ( 'Table' ) )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[Column1] ) = _group, 
        IF(Filter('Table', 'Table'[Column1] = _group) = _max , 1, 0 )
)

 

 

 

Thank you in advance

1 ACCEPTED SOLUTION
tamerj1
Community Champion
Community Champion

Hi @lazurens2 

do you want to flag the last record of each value of column1? If so please try

Best Score 2 =
VAR CurrentValue =
    SELECTEDVALUE ( 'Table'[Column2] )
VAR MaxValue =
    CALCULATE ( MAX ( 'Table'[Column2] ), ALLEXCEPT ( 'Table', 'Table'[Column1] ) )
RETURN
    IF ( CurrentValue = MaxValue, 1 )

View solution in original post

2 REPLIES 2
tamerj1
Community Champion
Community Champion

Hi @lazurens2 

do you want to flag the last record of each value of column1? If so please try

Best Score 2 =
VAR CurrentValue =
    SELECTEDVALUE ( 'Table'[Column2] )
VAR MaxValue =
    CALCULATE ( MAX ( 'Table'[Column2] ), ALLEXCEPT ( 'Table', 'Table'[Column1] ) )
RETURN
    IF ( CurrentValue = MaxValue, 1 )

Thank you very much, it's working !

Helpful resources

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

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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