I took a shot at explaining this, so hopefully it helps.
Try not to add columns using summarize, it is better to use ADDCOLUMNS and SUMMARIZE together.
I used variable to make this easier to follow.
//Gives a table of all the project keys
//Adds the Invoice Column to the summarized table
"Invoice Values with calculate",
"Invoice Values without calculate",
//Add Standard Deviation Columns
"Std Dev using Invoice Values with Calculate",
[Invoice Values with calculate]
"Sted Dev using Invoice Values without Calculate",
[Invoice Values without calculate]
__StdDevCard order by DimProject[DimProj PROJECT_KEY]
I did this using DaxStudio, but the same theory applies. I attached the query file below if you happen to use DaxStudio (not sure why the code isn’t formatted above), but I go through step-by-step to “See” what is happening.
More or less it just comes down to filter and row context. And how those change in measures.
Your second measure will give you the standard deviation of each project key. You are not summarizing that data, so the column for the Standard Deviation function is the column of Total invoice paid for that specific project key, and then gives you the standard deviation of that.
I hope that makes it somewhat clearer…
Std Dev Example EDNA.dax (955 Bytes)