Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
For HRS_STANDARD I calculated two variables, insteltijd and produktietijd. When I add those two at the return function, the calculation at line level is correct, however the total is incorrect. I tried SUMX(SUMMARIZE but I cannot select the two calculated variables when doing so. Can anyone help with the correct syntax?
Solved! Go to Solution.
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.
Hi,
Write this additional measure and drag this to the Table visual
=IF(HASONEVALUE(MFG_ORDER_NAME),[HRS_STANDARD],SUMX(SUMMARIZE(VALUES([MFG_ORDER_NAME]),[MFG_ORDER_NAME],"ABCD",[HRS_STANDARD]),[ABCD]))
Hope this helps.
Hi Ashish,
Tried following extra measure and dragged it into the visual. Still total is incorrect
Hi,
Share the link from where i can download your PBI file. Also, show the expected result in a tet box there.
Greg,
Your solution summarizes also 4.5 hours instead of 32.85 (See measure total).
For the PBix file see: https://drive.google.com/open?id=13X8wROZ0tyUlwI3uahNAZK_Y0u7EtVSy
Hi Ashish,
Hereby the link and expected result. I rebuild the Power BI file to a document based on excel. The original file is a file based on direct query on our data warehouse which I cannot share with underlying data.
This is the link: https://drive.google.com/open?id=13X8wROZ0tyUlwI3uahNAZK_Y0u7EtVSy
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |