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! Request now

Reply
Gaurangkd
New Member

How to show selected current week and selected past week from slicer into matrix table

Hello team,

 

How to show current selected week from one slicer and past selected week from other slicer into matrix table.

Week can be random selected from both slicer to get the difference between sales value from those selected week.

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Use a single slicer to let your report users pick any two weeks. Then use Visual Calculations to show the difference.

View solution in original post

Anonymous
Not applicable

Hi,

Thanks for the solution Omid_Motamedise  and lbendlin  offered, and i want to offer some more information for user to refer to.

hello @Gaurangkd , you can refer to the following solution.

Sample data 

vxinruzhumsft_0-1733725278722.png

 

Create a calendar table. and create 1:n relationship between tables.

Calendar = ADDCOLUMNS(CALENDAR(DATE(2024,1,1),DATE(2024,12,31)),"WeekNo",WEEKNUM([Date],2))

  

vxinruzhumsft_1-1733725320389.png

 

Then create a sum measure to calculte the sum.

Sum = SUM('Table'[Value])

Create a _diff measure to calculate the difference

_diff =
VAR a =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        OFFSET ( -1, ALLSELECTED ( 'Calendar'[WeekNo] ), ORDERBY ( [WeekNo], ASC ) )
    )
RETURN
    [Sum] - a

Then create a matrix, and put the following field to the visual.

vxinruzhumsft_2-1733725417298.png

 

Then create a slicer ,and put the weekNo column to the slicer. in the slicer ,select two week numbers, then in the matrix can diplay the sum and the difference of the two week.

vxinruzhumsft_3-1733725497223.png

 

Best Regards!

Yolo Zhu

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

3 REPLIES 3
Anonymous
Not applicable

Hi,

Thanks for the solution Omid_Motamedise  and lbendlin  offered, and i want to offer some more information for user to refer to.

hello @Gaurangkd , you can refer to the following solution.

Sample data 

vxinruzhumsft_0-1733725278722.png

 

Create a calendar table. and create 1:n relationship between tables.

Calendar = ADDCOLUMNS(CALENDAR(DATE(2024,1,1),DATE(2024,12,31)),"WeekNo",WEEKNUM([Date],2))

  

vxinruzhumsft_1-1733725320389.png

 

Then create a sum measure to calculte the sum.

Sum = SUM('Table'[Value])

Create a _diff measure to calculate the difference

_diff =
VAR a =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        OFFSET ( -1, ALLSELECTED ( 'Calendar'[WeekNo] ), ORDERBY ( [WeekNo], ASC ) )
    )
RETURN
    [Sum] - a

Then create a matrix, and put the following field to the visual.

vxinruzhumsft_2-1733725417298.png

 

Then create a slicer ,and put the weekNo column to the slicer. in the slicer ,select two week numbers, then in the matrix can diplay the sum and the difference of the two week.

vxinruzhumsft_3-1733725497223.png

 

Best Regards!

Yolo Zhu

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

 

Omid_Motamedise
Super User
Super User

You can add a column namely week in the date table and use it for filter, otherwise use the formula like below

 

Last week = CALCULATE(measure, DATESINPERIOD('Calendar'[date], TODAY(),-7,DAY))

 


If my answer helped solve your issue, please consider marking it as the accepted solution.
lbendlin
Super User
Super User

Use a single slicer to let your report users pick any two weeks. Then use Visual Calculations to show the difference.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.