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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

GET Current Row Column value using Measure

Hi Experts,

 I need to find the Current Row Column Value in Measure ( NOT Calculated Column) .

 

Am Having a DAX :

YTD_FINAL = var maxim = MAX('table'[month]) return CALCULATE( SUM('table'[sales] ), ALLEXCEPT('table','table'[year] ,'table'[zzmatnr] ), 'table'[month] <= maxim , 'table'[Year] = CURRENT ROW Year Column Value )
 
I Cant able to use (Earlier function) in that Filter in my Measure Tax .. 
can you Please help me out..
 Screenshot (2).png
 
Please Help me !! 
1 ACCEPTED SOLUTION

@chris_sam

So you need the total corrected? I hope the line amounts are giving the YTD correctly.

Try this measure:

YTD_FINAL = 
IF( HASONEVALUE('table'[zzmatnr]),
    CALCULATE( 
        SUM('table'[sales] ), 
        FILTER(
            ALLEXCEPT('table','table'[zzmatnr] ),
            'table'[month] <=MAX('table'[month]) , 'table'[Year] = MAX('table'[Year]) )
    ),
    SUM('table'[sales] )
 )

________________________

If my answer was helpful, consider Accepting it as the solution to help other members find it

Click the Thumbs-Up icon if you like this answer 🙂

Youtube Linkedin

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

View solution in original post

6 REPLIES 6
Fowmy
Super User
Super User

@Anonymous 

You cannot use the EARLIER function in this context, 

To get the result you are expecting, modify your measure this way:

YTD_FINAL = 

CALCULATE( 
    SUM('table'[sales] ), 
    FILTER(
        ALLEXCEPT('table','table'[zzmatnr] ),
        'table'[month] <=MAX('table'[month]) , 'table'[Year] = MAX('table'[Year]) )
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

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

Anonymous
Not applicable

@Fowmy  I tried you Measure.. Am Getting Wrong Value when am Using Two Years..Screenshot (3).png

 

YTD Calc Grand Total Should be  : 70 

 

Please Check with Screenshot... its not Working out..

@Anonymous 

 

Can you show  the expected results and explain please 

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

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

Anonymous
Not applicable

@Fowmy

This The 2018 month Value (Working Fine) :

Screenshot (9).png

This is 2019 Month 1 value :

Screenshot (10).png

Value which i need in Grand Total is 185 + 35 = 220 ... Value which am getting is 65 (ie . SUM of Year 2019 1st month , 7th Month and 13 Month which is am not even selected in Slicer .. i selected 2018 all months and 2019 1st Month Only)

Screenshot (11).png

@chris_sam

So you need the total corrected? I hope the line amounts are giving the YTD correctly.

Try this measure:

YTD_FINAL = 
IF( HASONEVALUE('table'[zzmatnr]),
    CALCULATE( 
        SUM('table'[sales] ), 
        FILTER(
            ALLEXCEPT('table','table'[zzmatnr] ),
            'table'[month] <=MAX('table'[month]) , 'table'[Year] = MAX('table'[Year]) )
    ),
    SUM('table'[sales] )
 )

________________________

If my answer was helpful, consider Accepting it as the solution to help other members find it

Click the Thumbs-Up icon if you like this answer 🙂

Youtube Linkedin

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

Anonymous
Not applicable

@Fowmy Screenshot (4).png

2018 all Value2018 all Value2019 1st Month Value2019 1st Month Value2019 1st Moth Value2019 1st Moth Value

Its also Taking The Sum of 1st Month of year 2018 Sales value with 1st Month 2019 Sales value

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.

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.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.