Forum Discussion
Anonymous
7 years agoNot applicable
Summarize multiple variables
Hi, I need to calculate the standard hours per MFG_ORDER_NAME. This calculated value per individual line is OK, but the sum is incorrect. I tried summarize function but I need help ons this. ...
- 7 years ago
I would probably go with something like:
Measure Total = VAR __table = SUMMARIZE('Table',[MFG_ORDER_NAME],[DEPARTMENT],[BASIS],"__hrsStandard",[HRS STANDARD]) VAR __total = SUMX(__table,[__hrsStandard]) RETURN IF(HASONEVALUE([DEPARTMENT]),[HRS STANDARD],__total)You may have to modify the SUMMARIZE.
Anonymous
7 years agoNot applicable
Thanks for your reply. I read your articles. Can you show how my calculation should look like?
Greg_Deckler
7 years agoCommunity Champion
I would probably go with something like:
Measure Total =
VAR __table = SUMMARIZE('Table',[MFG_ORDER_NAME],[DEPARTMENT],[BASIS],"__hrsStandard",[HRS STANDARD])
VAR __total = SUMX(__table,[__hrsStandard])
RETURN
IF(HASONEVALUE([DEPARTMENT]),[HRS STANDARD],__total)
You may have to modify the SUMMARIZE.