- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

ADDING ONE WITH CONDITIONS
Good morning
I want to add the "UNITS" column according to product, color and size per agent.
For example, Luis, 3 units, but it doubles me in this case to 6 units by the supplier.
Another example, Pedro, 30 units.
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

If you want to calculate the sum of units by agent and supplier, try this:
CALCULATE (
SUM ( 'table'[UNIDADES] ),
ALLEXCEPT ( 'table', 'table'[AGENTE], 'table'[PROVEEDOR] )
)
Dane Belarmino | Microsoft MVP | Proud to be a Super User!
Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Syndicate_Admin ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the calculated table.
Unique = SUMMARIZE(
'Table',
'Table'[AGENT],
'Table'[PRODUCT],
'Table'[COLOR],
'Table'[SIZE],
"UniqueUnits", MAX('Table'[UNIDADES])
)
3.Create the relationship between two tables.
4.Create the new Units column.
Units =
CALCULATE(
SUM('Unique'[UniqueUnits]),
ALLEXCEPT('Unique', 'Unique'[AGENT])
)
5.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Syndicate_Admin ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the calculated table.
Unique = SUMMARIZE(
'Table',
'Table'[AGENT],
'Table'[PRODUCT],
'Table'[COLOR],
'Table'[SIZE],
"UniqueUnits", MAX('Table'[UNIDADES])
)
3.Create the relationship between two tables.
4.Create the new Units column.
Units =
CALCULATE(
SUM('Unique'[UniqueUnits]),
ALLEXCEPT('Unique', 'Unique'[AGENT])
)
5.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello
First thank you for your message.
The results I want to get are the total units that I consult with the suppliers.
that is, in the 240801 consultation, agent Luis requests prices of 2 large red notebooks and 1 small green pencil. In total, Luis asks for a quote for 3 units from two different suppliers.
When adding the units in PowerBi it adds as many units as suppliers I have consulted. In this case it adds up to the 6 units because I have consulted two suppliers, but in reality I only consult 3 units (2 notebooks + 1 pencil).
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Syndicate_Admin ,
If you want to the units to counted just once by Agent, Product, Color and Size, use SUMX and SUMMARIZE in a measure.
Sum of Units =
SUMX (
SUMMARIZE (
'Table',
'Table'[ID],
'Table'[AGENT],
'Table'[PRODUCT],
'Table'[COLOR],
'Table'[SIZE],
'Table'[UNIDADES]
),
[UNIDADES]
)
Please see the attached pbix.
Dane Belarmino | Microsoft MVP | Proud to be a Super User!
Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

If you want to calculate the sum of units by agent and supplier, try this:
CALCULATE (
SUM ( 'table'[UNIDADES] ),
ALLEXCEPT ( 'table', 'table'[AGENTE], 'table'[PROVEEDOR] )
)
Dane Belarmino | Microsoft MVP | Proud to be a Super User!
Did I answer your question? Mark my post as a solution!
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-03-2024 10:26 AM | |||
02-09-2025 02:16 AM | |||
08-02-2024 03:08 AM | |||
10-17-2024 09:28 AM | |||
09-06-2024 06:08 AM |
User | Count |
---|---|
118 | |
105 | |
84 | |
52 | |
46 |