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 wanted to do achieve this “sql” code in a DAX variable
Select WeekYearWeekNumber from DimDate where Date = today()+7
How can achieve it?
So far I have this code, but the last line doesn’t work because nextw is more than a column…
var nextw =
FILTER(
SUMMARIZE('Date','Date'[Week Year Week Number],'Date'[Date]) ,
'Date'[Date]=TODAY()+7
)
var NextWCS =
FILTER(
SUMMARIZE(Staff, Staff[K_Emp], Staff[StaffingType], 'Date'[Week Year Week Number], Staff[IsTmed],
"sumat", SUM(Staff[Hours])
),
'Date'[Week Year Week Number]=nextw
)
Solved! Go to Solution.
Hi,
SELECTCOLUMNS is one way to do this:
I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi @Anonymous
This will give you a scalar that you can then use in NextWCS
Nextw =
CALCULATE(
SELECTEDVALUE('Date'[Week Year Week Number]),
'Date'[Date] = TODAY() + 7
)
@Anonymous what are you exactly trying to achieve? provide sample data and expected output?
Hi,
SELECTCOLUMNS is one way to do this:
I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 30 | |
| 19 | |
| 11 | |
| 10 |