Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I would like to generate "Aggregated_Qty" by adding "column," instead of "measure" in Power BI.
In this case, I would like to base on "Sales Order" and "SKU" to calculated aggregated qty.
For example, the first 1 and 2 lines are the same group of "Sales Order" and "SKU", so the "Aggregated_Qty" is 200+100=300.
Wonder if you could guid me how to write dax by adding column function? Thanks.
Customer | Site | Sales Order | Line | SKU | Date | qty | Aggregated_Qty |
A | BR | A125 | D1 | AA | 2022-05-10 | 200 | 300 |
B | BR | B125 | D2 | AA | 2022-06-20 | 100 | 300 |
A | CN | A123 | D2 | GG | 2022-06-15 | 100 | 200 |
A | CN | A125 | D2 | GG | 2022-06-18 | 50 | 200 |
B | CN | B125 | D1 | GG | 2022-06-19 | 50 | 200 |
A | US | A123 | D1 | JJ | 2022-06-10 | 2000 | 2250 |
B | US | B125 | D3 | JJ | 2022-06-21 | 200 | 2250 |
B | US | B125 | D3 | JJ | 2022-07-21 | 50 | 2250 |
Solved! Go to Solution.
@Anonymous create this column:
Agg Qty =
VAR _site = 'Table'[Site]
VAR _sku = 'Table'[SKU]
RETURN
CALCULATE(
SUM('Table'[qty]),
REMOVEFILTERS('Table'),
'Table'[Site] = _site,
'Table'[SKU] = _sku
)
@Anonymous create this column:
Agg Qty =
VAR _site = 'Table'[Site]
VAR _sku = 'Table'[SKU]
RETURN
CALCULATE(
SUM('Table'[qty]),
REMOVEFILTERS('Table'),
'Table'[Site] = _site,
'Table'[SKU] = _sku
)
@Anonymous my pleasure 🙂
Hey, check out my showcase report - got some high level stuff there 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |