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 have one table i am currently trying to work with in Power Bi. I have 2 columns, one is sales orders, the other is the zip code that the order went to. I am trying to figure out how I can find the total orders that have the same zip code associated to it.
What would be the best way to do this?
@nsessa , You can create new column and new measure like given below
new column = sumx(filter(table, [zip] = earlier([zip])),[sales])
new measure = sumx(filter(allselected(table), [zip] = max([zip])),[sales])
Hi,
Thank you both for the suggested solutions but neither of them to seem to work. The issue I am having in the beginning is that both the zip code & order column were in text format. I have changed to a whole number but whenever I try to create a visual off of the measure or column, I get an error message saying it can't display.
To get the total for the same zip code, you can use this measure expression
Total This Zipcode = CALCULATE(SUM(Table[Amount]), ALLEXCEPT(Table, Table[Zipcode]))
Replace with your actual table and column names.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @nsessa ,
Just drag both columns to a table visual for example and change the aggregation of the sales order to count.
So you have a total orders by zip code.
Hi @camargos88 thank you for that advice. Is there any way to do this as a measure though?
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 | |
7 | |
6 |
User | Count |
---|---|
15 | |
13 | |
11 | |
9 | |
8 |