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
sdas028
Helper I
Helper I

Date changes in column graph based on slicer selection

Hi, I also need help with a clustered column graph. I want to be able to compare the week that is being selected by the slicer with the previous week so for example if the slicer is week 32 then I want the column graph to display week 32 and week 31 costs. Please help

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hi@ sdas028

After my research, You can try to follow my steps like below:

Step 1:

Add a measure that contains last week costs

Last week = 
VAR currWeek =
    MAX ( StoreSales[Week id] )
RETURN
    CALCULATE (
        SUM(StoreSales[costs]),
        FILTER (
            ALL(  StoreSales ),
            StoreSales[Week id]
                IN GENERATESERIES ( MAX ( currWeek - 1, 1 ), currWeek-1, 1 )

Step 2:

Add filed costs and measure Last week into Value of column chart and week into Axis

 

Result:

For example

6.png

After select week4

7.png

Here is DEMO, please try it.

https://www.dropbox.com/s/p9tpqpxqnf792tf/Date%20changes%20in%20column%20graph%20based%20on%20slicer...

 

 

 

Best Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

Hi@ sdas028

After my research, You can try to follow my steps like below:

Step 1:

Add a measure that contains last week costs

Last week = 
VAR currWeek =
    MAX ( StoreSales[Week id] )
RETURN
    CALCULATE (
        SUM(StoreSales[costs]),
        FILTER (
            ALL(  StoreSales ),
            StoreSales[Week id]
                IN GENERATESERIES ( MAX ( currWeek - 1, 1 ), currWeek-1, 1 )

Step 2:

Add filed costs and measure Last week into Value of column chart and week into Axis

 

Result:

For example

6.png

After select week4

7.png

Here is DEMO, please try it.

https://www.dropbox.com/s/p9tpqpxqnf792tf/Date%20changes%20in%20column%20graph%20based%20on%20slicer...

 

 

 

Best Regards,

Lin

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

Hi Lin, 

 

Thanks for that, I figured out how to do it by adding in "This Week" and "Last Week" to the week dimension I had and then applying a filter for those labels and then a slicre for them also.

 

Thanks,

Sophie

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