Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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)))
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
9 |