Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I am pretty new to Power BI and have an issue regarding the subtotal values. I have an assignment where I need to create two matrix visuals based on specific labor types (type 1 and type 2 labor). Only way to get values for these labor types is based on the Min and Max aggregation. Min aggregation gets the data for type 2 labor and max aggregation gets data for type 1 labor. Here is how the chart looks:
Now issue I am having is that the values for labor hours and total direct cost (type 1 is based on max, and type 2 is based on min) are not adding up correctly in the row subtotal section as you can see in above image. What is the issue here?
I have also attached a sample application as well
https://www.dropbox.com/scl/fi/0vnzmdibcct2r57qyvffs/Sample.pbix?rlkey=3op2ddm0jq8seduq231rzkusv&dl=...
Thanks
Hi @axn1948 ,
You can create 4 measures by using the SUMMARIZE function to fix it.
max_hours = VAR _TABLE=SUMMARIZE('Matrix',[name],[description],[labor_unit],[labor_productivity],"Value",MAX('Matrix'[labor_hours]))
RETURN SUMX(_TABLE,[Value])
max_total = VAR _TABLE=SUMMARIZE('Matrix',[name],[description],[labor_unit],[labor_productivity],"Value",MAX('Matrix'[labor_total]))
RETURN SUMX(_TABLE,[Value])
min_hours = VAR _TABLE=SUMMARIZE('Matrix',[name],[description],[labor_unit],[labor_productivity],"Value",MIN('Matrix'[labor_hours]))
RETURN SUMX(_TABLE,[Value])
min_total = VAR _TABLE=SUMMARIZE('Matrix',[name],[description],[labor_unit],[labor_productivity],"Value",MIN('Matrix'[labor_total]))
RETURN SUMX(_TABLE,[Value])
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Stephen,
i realize I had made a mistake with the sample app. In the data model the fields are not from the same table. Labor hours, total cost, and description come from one table item. Name comes from a different table, and it isnt directly related with the item table. Productivity and unit come from a separate table as well but that is directly linked to the item table.
So whenever I try to create an expression, my table always goes into a timeout error or memory error. Whaf do I do here?
Hello @axn1948 ,
so the Min & Max functions won't sum in a total, they just give you the minimum of the column or the max.
check this out
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Proud to be a Super User! | |
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |