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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Display X last week based on user selection(week selected)

I have a problem building this formula 

I have a Line Chart showing some values per week 
I need that when a user selects a speceific wekk e.i week 50 the line chart filter to show the Week 50 and 12 Previuos weeks
so the line chart will show info from week 38 up to week 50 

is this possible?

The columns that I use for the Line Chart are just 
Week Number 
and a measure to show a percetange value 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and attached pbix file.

One of the ways is to create disconnected Week Number Table and use that as a slicer.

 

Picture1.png

 

Sum value: =
VAR weeknumberselect =
SELECTEDVALUE ( 'Week Number'[Week Number], MAX ( 'Week Number'[Week Number] ) )
RETURN
CALCULATE (
SUM ( Data[Value] ),
KEEPFILTERS ( Data[Week Number] <= weeknumberselect
&& Data[Week Number] >= weeknumberselect - 12 )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and attached pbix file.

One of the ways is to create disconnected Week Number Table and use that as a slicer.

 

Picture1.png

 

Sum value: =
VAR weeknumberselect =
SELECTEDVALUE ( 'Week Number'[Week Number], MAX ( 'Week Number'[Week Number] ) )
RETURN
CALCULATE (
SUM ( Data[Value] ),
KEEPFILTERS ( Data[Week Number] <= weeknumberselect
&& Data[Week Number] >= weeknumberselect - 12 )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


VahidDM
Super User
Super User

Hi @Anonymous 

 

Check this link:

 

https://www.vahiddm.com/post/weekly-time-intelligence-dax

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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