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 need some help in summing/subtotalling a column of values that are made up of a measure which does a lookupvalue.
I have a matrix report. In it are grouped projects and tasks within each project. I created a measure that does a lookupvalue to get the budgeted hours for each of those tasks based on the project name/task name. That seems to work fine. However subtotalling at the project level does not and also there is no grand total. The lookupvalue doesn't make sense to do at a project level without a task name.
The column Budgeted Hours is this measure:
budgethourlookupt = if(ISINSCOPE(cr7e9_timesheet[Program Task]), LOOKUPVALUE(cr7e9_programtasks[Budget Hours],cr7e9_programtasks[cr7e9_program],selectedvalue(cr7e9_timesheet[cr7e9_program]),cr7e9_programtasks[Name],SELECTEDVALUE(cr7e9_timesheet[Name 2]),0))
I'm not sure what to put in when it's not in scope (at the project level) that would represent what the subtotal of the project's tasks budgeted hours are.
I imagine if the subtotals can be figured out then the grand total will naturally appear (or I'll have to use the HASONEVALUE to determine when to do a grand total).
I hope someone can hep me figure this out.
@simontam , Try like
budgethourlookupt = Sumx( values(cr7e9_timesheet[Program Task]) ,calculate( if(ISINSCOPE(cr7e9_timesheet[Program Task]), LOOKUPVALUE(cr7e9_programtasks[Budget Hours],cr7e9_programtasks[cr7e9_program],selectedvalue(cr7e9_timesheet[cr7e9_program]),cr7e9_programtasks[Name],SELECTEDVALUE(cr7e9_timesheet[Name 2]),0)) ) )
Ok you were very close, I had to modify your formula a bit (removed the IF(INSCOPE...), perhaps you meant that. Doing that the results are now subtotalling like I wanted.
Thanks for the super fast response.
budgethourlookupt = SUMX(VALUES(cr7e9_timesheet[cr7e9_programtask]), CALCULATE(LOOKUPVALUE(cr7e9_programtasks[Budget Hours],cr7e9_programtasks[cr7e9_program],SELECTEDVALUE(cr7e9_timesheet[cr7e9_program]),cr7e9_programtasks[Name],SELECTEDVALUE(cr7e9_timesheet[Name 2]),0)))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |