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.
Hi All
I have a line Chart As below and I have Week Number and Year Slicer on my page
At the moment the chart below is only being sliced by my Year Slicer so I can see all the weeks of the selected year
How would I go about changing the chart so it only showed 4 Weeks of data on the X Axis based on the Week Selection of the Week Slicer as the Max week and then go back 3 weeks?
Hope that is clear
Thanks in advance for your help or pointers!
Solved! Go to Solution.
Hi, @Anonymous
I have simulated some data, you can try the following methods.
Week = WEEKNUM([Date])
Measure =
Var N1=CALCULATE(MAX('Table'[Week]),ALLSELECTED('Table'[Week]))
Var N2=CALCULATE(MAX('Table'[Week]),ALLSELECTED('Table'[Week]))-3
return
IF(SELECTEDVALUE('Table'[Week])>=N2&&SELECTEDVALUE('Table'[Week])<=N1,1,0)
Put measure into Filter and set it to equal 1.
Is this the result you expect? Only the largest 4 weeks are shown.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
I have simulated some data, you can try the following methods.
Week = WEEKNUM([Date])
Measure =
Var N1=CALCULATE(MAX('Table'[Week]),ALLSELECTED('Table'[Week]))
Var N2=CALCULATE(MAX('Table'[Week]),ALLSELECTED('Table'[Week]))-3
return
IF(SELECTEDVALUE('Table'[Week])>=N2&&SELECTEDVALUE('Table'[Week])<=N1,1,0)
Put measure into Filter and set it to equal 1.
Is this the result you expect? Only the largest 4 weeks are shown.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , For that you need an independent date/week table. then you can have more weeks
Have Week Rank column in both connected and disconnected table
Week Rank= RANKX(all('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[Week Rank])
var _min = _max -4
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Week Rank] >=_min && 'Date'[Week Rank] <=_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |