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 know this is a common question but I couldn't find a solution that I could apply probably because of the structure of the table.
We have a table which has a week rank so where week rank is 1 then its the current week, 2 is last week, 3 the week before and so on.
What I'm trying to do is SUM the results of the week selected + 1. So if week rank is 4 on the slicer then I would want to sum the ones where week num is 5
This is what I've done but its not working as I expected.
Thanks in advance
Solved! Go to Solution.
@molden2 Maybe:
Test LW Enrolment Rate =
VAR __WeekRank = SELECTEDVALUE('Prod tbl_Rep_Master_SummaryReport'[WeekRank])
VAR __Table = FILTER(ALL('Prod tbl_Rep_Master_SummaryReport'), [WeekRank] = __WeekRank || [WeekRank] = __WeekRank + 1)
VAR __Result = SUMX(__Table, [Meters])
RETURN
__Result
@molden2 Maybe:
Test LW Enrolment Rate =
VAR __WeekRank = SELECTEDVALUE('Prod tbl_Rep_Master_SummaryReport'[WeekRank])
VAR __Table = FILTER(ALL('Prod tbl_Rep_Master_SummaryReport'), [WeekRank] = __WeekRank || [WeekRank] = __WeekRank + 1)
VAR __Result = SUMX(__Table, [Meters])
RETURN
__Result
@Greg_Deckler Thats a great help thank you. It actually summed up 2 weeks together but I just edited it and works perfectly.
Could you explain what the || part of your code is doing though?
Thanks again
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 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |