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
I am trying to create two tables in Power BI report based on a date selected from the slicer. The first table needs to have dates for all days of the week belonging to the selected date. The second table needs to have all the dates of the previous week. Please help me to achieve this,
Solved! Go to Solution.
Hi @kamalmsharma,
I hope you mean the table visual rather than the calculated table, which doesn't respond to the slicer.
Please download a demo from the attachment.
1. Create a slicer table without any relationship to other tables.
2. Create two measures.
thisWeek =
VAR selectedDate =
SELECTEDVALUE ( 'SlicerTable'[Date] )
RETURN
IF (
ISBLANK ( selectedDate ),
BLANK (),
IF ( WEEKNUM ( MIN ( 'Table'[Date] ) ) = WEEKNUM ( selectedDate ), 1, BLANK () )
)
previousWeek =
VAR selectedDate =
SELECTEDVALUE ( 'SlicerTable'[Date] )
RETURN
IF (
ISBLANK ( selectedDate ),
BLANK (),
IF (
WEEKNUM ( MIN ( 'Table'[Date] ) )
= WEEKNUM ( selectedDate ) - 1,
1,
BLANK ()
)
)
3. Either adding the measures in the table or putting in the Visual Level Filter.
Best Regards,
Dale
Hi @kamalmsharma,
I hope you mean the table visual rather than the calculated table, which doesn't respond to the slicer.
Please download a demo from the attachment.
1. Create a slicer table without any relationship to other tables.
2. Create two measures.
thisWeek =
VAR selectedDate =
SELECTEDVALUE ( 'SlicerTable'[Date] )
RETURN
IF (
ISBLANK ( selectedDate ),
BLANK (),
IF ( WEEKNUM ( MIN ( 'Table'[Date] ) ) = WEEKNUM ( selectedDate ), 1, BLANK () )
)
previousWeek =
VAR selectedDate =
SELECTEDVALUE ( 'SlicerTable'[Date] )
RETURN
IF (
ISBLANK ( selectedDate ),
BLANK (),
IF (
WEEKNUM ( MIN ( 'Table'[Date] ) )
= WEEKNUM ( selectedDate ) - 1,
1,
BLANK ()
)
)
3. Either adding the measures in the table or putting in the Visual Level Filter.
Best Regards,
Dale
Thank you so much for this excellent solution and sample file. It worked perfectly.
Regards,
Kamal
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |