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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Jyothishree
Helper II
Helper II

Charts must show up only previous week data depending on the Max date selected in Date Slicer.

Hello, I am looking for a solution where the data display on chart must show up only the data Previous week data depending on the user selection on Date slicer. For example if the user selects the Date Range (28.08.23 to 13.08.24), the chart must display the the data from 05.08.24 to 11.08.24 and if the user select a different date range say 01.01.24 to 31.01.24 then depending on the Max date(31.01.24), the charts must display (22.01.24 to 28.01.24). I created a weekoffset column and applied weekoffset is -1 in filterpane for the chart visual. This works for the default max date (Today)  but when the user selects a different date range then the chart goes blank. Also, I created 'IsInLastWeek' column in date table using dax and applied it on chart visual and selected 1.

IsInLastWeek =
IF(
    DateTable[isInCurrentYear] && DateTable[Week] = WEEKNUM(TODAY()) - 1,
    1,
    0
) but this also works similar to Week Offset, which does not satisfy the dynamic date selection in date slicer.

Any help is appreciated!


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

Hi @Jyothishree ,

 

Let me explain why your data doesn't change dynamically based on the slicer.

The key is that the value of a calculated column is static and is not affected by slicers or other visuals, I suggest you using measure instead. I’ve made a test for your reference:

1\I assume there is a table named Tabelle1

vbofengmsft_0-1723516860668.png

2\Create a calculate table

 

CalendarTable = CALENDAR(date(2024,1,1),date(2024,12,31))

 

3\Create a measure for Tabelle1

 

IsInLastWeek = If(WEEKNUM(Max(Tabelle1[Date]))=Weeknum(Max(CalendarTable[Date]))-1,1,0)

 

4\Add a slider

vbofengmsft_1-1723516860671.png

5\Filter data

vbofengmsft_0-1723516945428.png

 

Best Regards,

Bof

 

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @Jyothishree ,

 

Let me explain why your data doesn't change dynamically based on the slicer.

The key is that the value of a calculated column is static and is not affected by slicers or other visuals, I suggest you using measure instead. I’ve made a test for your reference:

1\I assume there is a table named Tabelle1

vbofengmsft_0-1723516860668.png

2\Create a calculate table

 

CalendarTable = CALENDAR(date(2024,1,1),date(2024,12,31))

 

3\Create a measure for Tabelle1

 

IsInLastWeek = If(WEEKNUM(Max(Tabelle1[Date]))=Weeknum(Max(CalendarTable[Date]))-1,1,0)

 

4\Add a slider

vbofengmsft_1-1723516860671.png

5\Filter data

vbofengmsft_0-1723516945428.png

 

Best Regards,

Bof

 

Thank you @v-bofeng-msft 

I am not able to access the PBI file you have shared. As it comes in Zip folder and when I extract, it says This file is restricted.

Hi @Jyothishree ,

 

I've reuploaded the attachment. Kindly take a moment to review it.

 

Best Regards,

Bof

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors