Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi, in my report I have bar chart with weeknr as x-axel ex 202223, I want have a weeknr range like from current week+20,
example: current week is 202244 so my x axel will be like 202244, 202245,202246...... 202311.
I dont have any date column only one weeknr column like 202021,202022 etc.
Solved! Go to Solution.
Here is one way.
Based on this sample data
I created a dimension table for weeks including an index column which we will use to filter the visual with a measure:
Week Table =
ADDCOLUMNS (
VALUES ( 'Table'[Week] ),
"Index", RANKX ( VALUES ( 'Table'[Week] ), 'Table'[Week],, ASC )
)
Create the following measure to add to the filters on the visual, settin the value to equals 1.
Filter weeks =
VAR _TodayWeek =
YEAR ( TODAY () ) * 100
+ WEEKNUM ( TODAY () )
VAR _CurrWeekIndex =
CALCULATE (
MAX ( 'Week Table'[Index] ),
FILTER ( ALL ( 'Week Table' ), 'Week Table'[Week] = _TodayWeek )
)
RETURN
COUNTROWS (
FILTER (
'Week Table',
'Week Table'[Week] >= _TodayWeek
&& 'Week Table'[Index] <= _CurrWeekIndex + 20
)
)
Sample PBIX file attached
Proud to be a Super User!
Paul on Linkedin.
Here is one way.
Based on this sample data
I created a dimension table for weeks including an index column which we will use to filter the visual with a measure:
Week Table =
ADDCOLUMNS (
VALUES ( 'Table'[Week] ),
"Index", RANKX ( VALUES ( 'Table'[Week] ), 'Table'[Week],, ASC )
)
Create the following measure to add to the filters on the visual, settin the value to equals 1.
Filter weeks =
VAR _TodayWeek =
YEAR ( TODAY () ) * 100
+ WEEKNUM ( TODAY () )
VAR _CurrWeekIndex =
CALCULATE (
MAX ( 'Week Table'[Index] ),
FILTER ( ALL ( 'Week Table' ), 'Week Table'[Week] = _TodayWeek )
)
RETURN
COUNTROWS (
FILTER (
'Week Table',
'Week Table'[Week] >= _TodayWeek
&& 'Week Table'[Index] <= _CurrWeekIndex + 20
)
)
Sample PBIX file attached
Proud to be a Super User!
Paul on Linkedin.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |