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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Kimcha
Advocate I
Advocate I

Use slicer value in a measure

Hi, 

 

I have a report that is showing data on a week number basis. I have two slicers that allow me to select the year & week.

 

The data below shows the sales stats only within that week.

 

But I would like to add a few year-to-date measures to that report page, which start from the selected year until the last day of the week.

 

My plan is to create a table visual that has only has an interaction with the year slicer, but not with the week slicer.

 

But then I still nead to create a YTD measure that somehow limits the calculation up to max(week_slicer).

 

Any ideas of how I could accomplish this?

1 ACCEPTED SOLUTION
Kimcha
Advocate I
Advocate I

Actually, I think I just figured it out, but perhaps you could help me guide on whether that is the ideal way of doing it.

 

I created the following measure:

YTD - Total Revenue = var selected_week = MAX(BasicCalendarEnglishDynamic[ISO WeekNumber]) RETURN CALCULATE(SUM('IS Orders'[TotalDue]), ALL(BasicCalendarEnglishDynamic[ISO WeekNumber]), BasicCalendarEnglishDynamic[ISO WeekNumber] <= selected_week)

And I abondoned my initial idea of disabling interaction for that specific visiual.

View solution in original post

1 REPLY 1
Kimcha
Advocate I
Advocate I

Actually, I think I just figured it out, but perhaps you could help me guide on whether that is the ideal way of doing it.

 

I created the following measure:

YTD - Total Revenue = var selected_week = MAX(BasicCalendarEnglishDynamic[ISO WeekNumber]) RETURN CALCULATE(SUM('IS Orders'[TotalDue]), ALL(BasicCalendarEnglishDynamic[ISO WeekNumber]), BasicCalendarEnglishDynamic[ISO WeekNumber] <= selected_week)

And I abondoned my initial idea of disabling interaction for that specific visiual.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors