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
I have one Scenario,
I wanted to create one calculated column for Matrix Table
Scenario : Slected Year 2023 Current year
Current Week (32)
I wanted to return Week Column numbers from Current Week to next 25 weeks (6 months)
if its 33 week as current week number table should start from 33 and next 25 weeks
Note : It should not populate anything if user select any other year, it should populate if its current year
i have attached the excel image as expected output
Hoping Best Solutions for this above post
Simple enough
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
I cannot create what exactly tou expected, the below will create some similar output.
1. I simulate a table Slicer_selection which acts as the available selection of year in the slicer.
2. Create a calculated table as below.
Dynamic Table =
VAR t = {
(YEAR(TODAY()),WEEKNUM(TODAY(),21),YEAR(TODAY())),
(YEAR(TODAY()+7),WEEKNUM(TODAY()+7,21),YEAR(TODAY())),
(YEAR(TODAY()+7*2),WEEKNUM(TODAY()+7*2,21),YEAR(TODAY())),
(YEAR(TODAY()+7*3),WEEKNUM(TODAY()+7*3,21),YEAR(TODAY())),
(YEAR(TODAY()+7*4),WEEKNUM(TODAY()+7*4,21),YEAR(TODAY())),
(YEAR(TODAY()+7*5),WEEKNUM(TODAY()+7*5,21),YEAR(TODAY())),
(YEAR(TODAY()+7*6),WEEKNUM(TODAY()+7*6,21),YEAR(TODAY())),
(YEAR(TODAY()+7*7),WEEKNUM(TODAY()+7*7,21),YEAR(TODAY())),
(YEAR(TODAY()+7*8),WEEKNUM(TODAY()+7*8,21),YEAR(TODAY())),
(YEAR(TODAY()+7*9),WEEKNUM(TODAY()+7*9,21),YEAR(TODAY())),
(YEAR(TODAY()+7*10),WEEKNUM(TODAY()+7*10,21),YEAR(TODAY())),
(YEAR(TODAY()+7*11),WEEKNUM(TODAY()+7*11,21),YEAR(TODAY())),
(YEAR(TODAY()+7*12),WEEKNUM(TODAY()+7*12,21),YEAR(TODAY())),
(YEAR(TODAY()+7*13),WEEKNUM(TODAY()+7*13,21),YEAR(TODAY())),
(YEAR(TODAY()+7*14),WEEKNUM(TODAY()+7*14,21),YEAR(TODAY())),
(YEAR(TODAY()+7*15),WEEKNUM(TODAY()+7*15,21),YEAR(TODAY())),
(YEAR(TODAY()+7*16),WEEKNUM(TODAY()+7*16,21),YEAR(TODAY())),
(YEAR(TODAY()+7*17),WEEKNUM(TODAY()+7*17,21),YEAR(TODAY())),
(YEAR(TODAY()+7*18),WEEKNUM(TODAY()+7*18,21),YEAR(TODAY())),
(YEAR(TODAY()+7*19),WEEKNUM(TODAY()+7*19,21),YEAR(TODAY())),
(YEAR(TODAY()+7*20),WEEKNUM(TODAY()+7*20,21),YEAR(TODAY())),
(YEAR(TODAY()+7*21),WEEKNUM(TODAY()+7*21,21),YEAR(TODAY())),
(YEAR(TODAY()+7*22),WEEKNUM(TODAY()+7*22,21),YEAR(TODAY())),
(YEAR(TODAY()+7*23),WEEKNUM(TODAY()+7*23,21),YEAR(TODAY())),
(YEAR(TODAY()+7*24),WEEKNUM(TODAY()+7*24,21),YEAR(TODAY())),
(YEAR(TODAY()+7*25),WEEKNUM(TODAY()+7*25,21),YEAR(TODAY()))
}
RETURN
SELECTCOLUMNS(t,"Year",[Value1],"Week",[Value2],"CurrentYear",[Value3])
3. Create a many-to-one relationship between the two tables as below.
4. Build a matrix using [Year] and [Week] from Dynamic Table, and the slicer using [Year] from Slicer_selection.
You will then come up with the above. Selection of year other than current year will yield nothing for the matrix.
You may need to refresh weekly for the dymnamic table to update with the correct week numbers.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 41 | |
| 33 | |
| 29 | |
| 27 |
| User | Count |
|---|---|
| 132 | |
| 112 | |
| 58 | |
| 57 | |
| 57 |