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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

8 dernière semaines

Bonjour,

 

J'aimerai créer une graphique qui me reprend les 8 dernières semaines suivant la semaine sélectionné dans un segment. 

J'ai une table de créé avec la date, une colonne avec le Weeknum.

 

Je ne sais pas comment procéder pour que dès qu'un utilisateur clique sur une semaine du segment, (exemple : S6, cela va créer le graphique avec S1 - S2 - S3 - S4 - S5 - S6.

S'il clique sur S12, ça va créer le graphique avec S5,6,7,8,9,10,11,12... etc...
J'ai déjà fait plein de tests, mais aucuns concluants...

Avez-vous des idées svp ??

Merci d'avance !!

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

Thanks for the reply from amitchandak and rajendraongole1.

 

Hi @Anonymous  , 

Here I have another idea in mind, and I would like to share it for reference.

 

1.Create simple data, the following figure is Table and Table 2 is the copy of Table:

 vlinhuizhmsft_0-1724234819587.png

 

2. Create a measure:

 Measure = VAR _current_select = SELECTEDVALUE('Table 2'[Year_weeknum]) VAR _min = _current_select-8 RETURN IF(SELECTEDVALUE('Table'[Year_weeknum])>=_min&&SELECTEDVALUE('Table'[Year_weeknum])<=_current_select,1,0) 

 

3.Then use measure to filter on the visual:

 vlinhuizhmsft_0-1724236300633.png

vlinhuizhmsft_0-1724236925199.png

 

4.Use Year_weeknum from Table 2 as the slicer field, and the final result is as follows:

 vlinhuizhmsft_3-1724236535186.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

 

 

View solution in original post

3 REPLIES 3
v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from amitchandak and rajendraongole1.

 

Hi @Anonymous  , 

Here I have another idea in mind, and I would like to share it for reference.

 

1.Create simple data, the following figure is Table and Table 2 is the copy of Table:

 vlinhuizhmsft_0-1724234819587.png

 

2. Create a measure:

 Measure = VAR _current_select = SELECTEDVALUE('Table 2'[Year_weeknum]) VAR _min = _current_select-8 RETURN IF(SELECTEDVALUE('Table'[Year_weeknum])>=_min&&SELECTEDVALUE('Table'[Year_weeknum])<=_current_select,1,0) 

 

3.Then use measure to filter on the visual:

 vlinhuizhmsft_0-1724236300633.png

vlinhuizhmsft_0-1724236925199.png

 

4.Use Year_weeknum from Table 2 as the slicer field, and the final result is as follows:

 vlinhuizhmsft_3-1724236535186.png

 

Best Regards,
Zhu
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

 

 

rajendraongole1
Super User
Super User

Hi @Anonymous - Can you please translate to engilish and share the expectations

 

Thank you





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





amitchandak
Super User
Super User

@Anonymous , In case you select a week and want to display more than one week as trend(Group/Axis), then you need a disconnected table

 

Have week rank column in date and disconnected date table (Date1/DateInd)

 

Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Rank])
var _min = _max -8
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Rank] >=_min && 'Date'[Rank] <=_max))

 

 

 

//DateInd is joined with Inactive join, Date is joined with Table with Active join.
new measure =
Var _max = Max('Date'[Rank])
var _min = _max -8
return
CALCULATE( sum(sales[Gross Sales]),filter(ALL('Date'), 'Date'[Rank]>=_min && 'Date'[Rank]<=_max) ,USERELATIONSHIP('DateInd'[Date], Sales[Sales Date]))

 

Create a 12-Month Trend with Single Slicer Selection on connected Date table- https://www.youtube.com/watch?v=7dPrPk6LPYU&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=2

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors