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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
hueuro
Frequent Visitor

ytd running

i have created a mesure,but its picking LASTYEAR value while seaching WITH slizer

hueuro_0-1702638123674.pnghueuro_1-1702638169409.png

dax:CALCULATE(SUM(SALES[Sales Amount]),FILTER(ALL(SALES),SALES[Posting Date]<=MAX(SALES[Posting Date]) && [SALES GROUP]=MAX(SALES[SALES GROUP])))

i want to get only the currnet year

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @hueuro ,

Please try this way:
Here is my sample data:

vjunyantmsft_0-1702869351865.png

I create a slicer accroding to this table:

vjunyantmsft_1-1702869386493.png

Try to use this DAX to create a new measure:

Measure = 
CALCULATE(
    SUM('Table'[Sales Amount]),
    'Table'[Sales Group] = SELECTEDVALUE('Table'[Sales Group]),
    DATESBETWEEN(
        'Table'[Posting Date],
        STARTOFYEAR('Date'[Date]),
        SELECTEDVALUE('Date'[Date])
    )
)

vjunyantmsft_2-1702869442668.pngvjunyantmsft_3-1702869525027.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @hueuro ,

Please try this way:
Here is my sample data:

vjunyantmsft_0-1702869351865.png

I create a slicer accroding to this table:

vjunyantmsft_1-1702869386493.png

Try to use this DAX to create a new measure:

Measure = 
CALCULATE(
    SUM('Table'[Sales Amount]),
    'Table'[Sales Group] = SELECTEDVALUE('Table'[Sales Group]),
    DATESBETWEEN(
        'Table'[Posting Date],
        STARTOFYEAR('Date'[Date]),
        SELECTEDVALUE('Date'[Date])
    )
)

vjunyantmsft_2-1702869442668.pngvjunyantmsft_3-1702869525027.png

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.