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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
SCannaerts
Regular Visitor

Slicer on measure

Hello,

 

I have this measure "current year - previous year":

CALCULATE(SUM('Turnover'[Turnover]), YEAR('date'[Date])=YEAR(Today()))-CALCULATE(SUM('Turnover'[Turnover]), YEAR('date'[Date])=YEAR(Today())-1)
 
When I use a quarter slicer (q1, q2, q3, q4) based on the quarter on the Date Hierarchy in the date table the results of the measure don't change. 
 
How can I solve this?
 
Thanks
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @SCannaerts ,

Try to use the below dax ,if not work ,could you pls share sample data,remember to remove confident data.

daxx =
CALCULATE (
    SUM ( 'Turnover'[Turnover] ),
    FILTER ( ALL ( 'date' ), YEAR ( 'date'[Date] ) = YEAR ( TODAY () ) )
)
    - CALCULATE (
        SUM ( 'Turnover'[Turnover] ),
        FILTER ( ALL ( 'date' ), YEAR ( 'date'[Date] ) = YEAR ( TODAY () ) - 1 )
    )

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

There should be a relationship from the Date column of the Turnover table to the Date column of the Date Table.  In the Date Table, you should have columns for Year, Month name and Month number.  Sort the Month name by the Month number.  To your slicer, drag Year from the Date Table.  Write these measures

Total = sum('Turnover'[Turnover])

Total in PY = calculate([Total],previousyear(Date[Date]))

Diff = [total]-[total in PY]

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-luwang-msft
Community Support
Community Support

Hi @SCannaerts ,

Try to use the below dax ,if not work ,could you pls share sample data,remember to remove confident data.

daxx =
CALCULATE (
    SUM ( 'Turnover'[Turnover] ),
    FILTER ( ALL ( 'date' ), YEAR ( 'date'[Date] ) = YEAR ( TODAY () ) )
)
    - CALCULATE (
        SUM ( 'Turnover'[Turnover] ),
        FILTER ( ALL ( 'date' ), YEAR ( 'date'[Date] ) = YEAR ( TODAY () ) - 1 )
    )

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors