Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I need to create a calculated column "Total Units" that totals the unit sales by Order Number without reference to row context. I need the total as a calculated column since I will create a new dimension based on the size of the total. Unit Category = if [Total Units] < 100000 then "Small" else "Big"
See example below. I need a formula so that for each row where it shows order number "1000", that the new Total Units column total is 75,000.
This seems like it should be easy, but I have spent all day trying to figure this out. Sorry, I'm a newbie.
Solved! Go to Solution.
=calculate(sum(table[units]),filter(table,table[ordernumber]=earlier(table[ordernumber]))
be sure to write only 1 calculated colum, not 2. Get the one above working first, then modify it to return "big" or "small". This is better than having 2 columns
=calculate(sum(table[units]),filter(table,table[ordernumber]=earlier(table[ordernumber]))
be sure to write only 1 calculated colum, not 2. Get the one above working first, then modify it to return "big" or "small". This is better than having 2 columns
Worked perfect Matt. Thanks so much. I had not even heard of the EARLIER function until just now.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |