Forum Discussion
Sum Breakdown
Hi and good day, can anyone help me on how can i get the result we required. I have a table and base from Column "CountMAX/Week/Vessel" I want the breakdown same as this
| CAT BP's | Location | Trade_to_USED | Week No: | CountMAX/Week/Vessel | Direct/InDirect |
| Mech | South | Trade01 | 34 | 32 | Direct |
| Civil | South | Trade01 | 34 | 32 | Direct |
| Elec | South | Trade01 | 34 | 32 | InDirect |
| Elec | South | Trade01 | 34 | 32 | Direct |
| Civil | South | Trade01 | 34 | 32 | InDirect |
| Mech | South | Trade01 | 34 | 32 | Direct |
| Elec | South | Trade01 | 34 | 32 | Direct |
| Elec | South | Trade01 | 34 | 32 | InDirect |
| Civil | South | Trade01 | 34 | 32 | Direct |
| Elec | South | Trade02 | 34 | 32 | Direct |
| Civil | South | Trade02 | 34 | 32 | Direct |
| Elec | South | Trade02 | 34 | 32 | InDirect |
| Elec | South | Trade02 | 34 | 32 | Direct |
| Mech | South | Trade02 | 34 | 32 | Direct |
| Civil | South | Trade03 | 34 | 32 | InDirect |
| Civil | North | Trade03 | 34 | 32 | Direct |
| Elec | North | Trade03 | 34 | 32 | Direct |
| Mech | North | Trade03 | 34 | 32 | InDirect |
| Elec | North | Trade03 | 34 | 32 | Direct |
| Civil | North | Trade03 | 34 | 32 | Direct |
| Mech | North | Trade03 | 34 | 32 | Direct |
| Elec | North | Trade04 | 34 | 32 | InDirect |
| Elec | North | Trade04 | 34 | 32 | Direct |
| Mech | North | Trade04 | 34 | 32 | InDirect |
| Elec | North | Trade04 | 34 | 32 | Direct |
| Civil | North | Trade04 | 34 | 32 | Direct |
| Mech | North | Trade04 | 34 | 32 | Direct |
| Elec | North | Trade04 | 34 | 32 | InDirect |
| Elec | North | Trade05 | 34 | 32 | Direct |
| Mech | North | Trade05 | 34 | 32 | Direct |
| Civil | North | Trade05 | 34 | 32 | InDirect |
| Elec | North | Trade05 | 34 | 32 | Direct |
| Elec | North | Trade05 | 35 | 24 | InDirect |
| Elec | North | Trade05 | 35 | 24 | Direct |
| Elec | North | Trade06 | 35 | 24 | InDirect |
| Mech | North | Trade06 | 35 | 24 | Direct |
| Elec | North | Trade06 | 35 | 24 | Direct |
| Elec | North | Trade06 | 35 | 24 | InDirect |
| Mech | North | Trade06 | 35 | 24 | Direct |
| Civil | North | Trade06 | 35 | 24 | InDirect |
| Elec | North | Trade06 | 35 | 24 | Direct |
| Mech | North | Trade06 | 35 | 24 | InDirect |
| Elec | North | Trade07 | 35 | 24 | InDirect |
| Civil | South | Trade07 | 35 | 24 | Direct |
| Mech | South | Trade07 | 35 | 24 | InDirect |
| Elec | South | Trade07 | 35 | 24 | Direct |
| Civil | South | Trade07 | 35 | 24 | InDirect |
| Mech | South | Trade07 | 35 | 24 | Direct |
| Elec | South | Trade07 | 35 | 24 | Direct |
| Elec | South | Trade07 | 35 | 24 | Direct |
| Mech | South | Trade07 | 35 | 24 | InDirect |
| Elec | South | Trade07 | 35 | 24 | Direct |
| Civil | South | Trade07 | 35 | 24 | InDirect |
| Mech | South | Trade07 | 35 | 24 | Direct |
| Elec | South | Trade07 | 35 | 24 | InDirect |
| Civil | South | Trade07 | 35 | 24 | Direct |
Hi AllanBerces ,
Thank you for the update.
Can you please provide correct sample data in a form of table or a file and not in screenshot?
This will help us understand your data better and it would be easier to provide you proper solution.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you for understanding.
12 Replies
- AllanBercesPost Prodigy
CountMAX/Week/Vessel is come from my calculated column
CountMAX/Week/Vessel =VAR _currentWeek = 'Table01'[Week No:]VAR _currentCode = 'Table01'[Location]RETURNCALCULATE (MAX ( 'Table01'[Count/Trade/Vessel] ),FILTER (ALL ( 'Table01' ),'Table01'[Week No:] = _currentWeek &&'Table01'[Used_Vessel Code] = _currentCode)) - FarhanJeelaniSuper User
Hi AllanBerces ,
Create two measures (one for Direct, one for Indirect) that sum CountMAX/Week/Vessel filtered by the Direct/InDirect flag.
Build a matrix with Week No, Location, Trade_to_USED as rows. Put Direct Count and Indirect Count as values (two columns).
DAX (adjust to your actual table/column names)Direct count Direct Count = CALCULATE( SUM( 'YourTable'[CountMAX/Week/Vessel] ), 'YourTable'[Direct/InDirect] = "Direct" )
Indirect count Indirect Count = CALCULATE( SUM( 'YourTable'[CountMAX/Week/Vessel] ), 'YourTable'[Direct/InDirect] = "InDirect" )
Optional: a Grand Total measure (not strictly needed if you just want the sum) Grand Total = [Direct Count] + [Indirect Count]
Building the matrix
Rows: Week No, Location, Trade_to_USED (in that order for the same nesting as your sample)
Columns: Direct Count (first column) and Indirect Count (second column)
Values: Direct Count, Indirect Count (you can remove the Grand Total measure from the matrix since the matrix will show sums, and you can enable the total if you want)Please mark this post as solution if it helps you. Appreciate Kudos.
- AllanBercesPost Prodigy
Hi FarhanJeelani thank you for the reply but the result is not correct, on my table i have a date column let say Week 34 from 18 - 24 of Aug and another column the value on each day let say Aug 18=23 Aug 19=37 and so on . and on my column CountMAX/Week/Vessel will register the highest number Let say Aug 19 is the highest then 37 will register on my column CountMAX/Week/Vessel and that 37 i want to breakdown.
- Shahid12523Community Champion
Use Power BI
- Rows: Location, CAT BP's
- Columns: Week No, Direct/InDirect
- Values: Count of rows (or sum CountMAX/Week/Vessel if needed)
✅ Or use DAX:
SummaryTable =
SUMMARIZE(
YourData,
YourData[Week No],
YourData[Location],
YourData[CAT BP's],
YourData[Direct/InDirect],
"Count", COUNTROWS(YourData)
)
This gives you the exact breakdown by week, location, category, and Direct/InDirect.- AllanBercesPost Prodigy
Hi Shahid12523 thank you for the reply but it not givin the right value. it summarize all the data in a week, what we required is the breakdown of the highest value on the particular day of the week.
- AllanBercesPost Prodigy
Hi something like this on one location. but i have multiple location
- AllanBercesPost Prodigy
- danextianSuper User
How did you come up with the numbers in your expected result? Counting the rows don't match. Please use a sample data that actually represents the data in your semantic model.
- AllanBercesPost Prodigy
Hi danextian thank you for the reply, my mistake on that can use below and result we required
Thank you
- v-sdhruvCommunity Support
Hi AllanBerces ,
Thank you for the update.
Can you please provide correct sample data in a form of table or a file and not in screenshot?
This will help us understand your data better and it would be easier to provide you proper solution.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you for understanding. - v-sdhruvCommunity Support
Hi AllanBerces ,
Can you please provide correct sample data in a form of table or a file and not in screenshot?
This will help us understand your data better and it would be easier to provide you proper solution.
Thank You - v-sdhruvCommunity Support
Hi AllanBerces ,
Since we didnt hear back, we would be closing this thread.
If you need any assistance, feel free to reach out by creating a new post.
Thank you for using Microsoft Community Forum