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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Wout
Helper I
Helper I

Showing turnover 2016/2017 - 6 weeks before and 6 weeks after the current date

Hi Forum,

 

I have a dashboardpage about the weekly sales numbers of 2016 and 2017,  - Clustered column chart.

 

Is it possible to show only the sales numbers 6 weeks before and 6 weeks after the current date?

 

Thanks.

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Wout,

 

Suppose you add a [WeekNum] column on chart X-axis, please create measures similar to below:

currentWeek = WEEKNUM(TODAY())

flag =
IF (
    [currentWeek] - MAX ( WeeklySales[WeekNum] )
        <= 6
        && [currentWeek] - MAX ( WeeklySales[WeekNum] )
            >= -6,
    1,
    0
)

Select the clustered column chart, add above measure [flag] into Visual Level filter.

1.PNG

 

Best regards,
Yuliana Gu

 

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

4 REPLIES 4
v-yulgu-msft
Employee
Employee

Hi @Wout,

 

Suppose you add a [WeekNum] column on chart X-axis, please create measures similar to below:

currentWeek = WEEKNUM(TODAY())

flag =
IF (
    [currentWeek] - MAX ( WeeklySales[WeekNum] )
        <= 6
        && [currentWeek] - MAX ( WeeklySales[WeekNum] )
            >= -6,
    1,
    0
)

Select the clustered column chart, add above measure [flag] into Visual Level filter.

1.PNG

 

Best regards,
Yuliana Gu

 

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

Thanks! It works!?

Do you also know what happens when it's week 48+ for example

Hi @Wout,

 

The week number showed on X-axis will be dynamically changed when week num is over 48. It always shows the sales numbers 6 weeks before and 6 weeks after the current date.

 

Regards,
Yuliana Gu

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

Yes,  by creating two columns that will return the weeks before and after your current week. 

 

Can you please share the PBIX? 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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