Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
So if I have a table like this that has a list of ZIPs delivered to and the week they're delivered, except for the bold column. That's the column I need to build.
tRaw
| ZIP | Week | Weekly Total | ||
| 12345 | 1 | 3 | ||
| 12345 | 1 | 3 | ||
| 12345 | 1 | 3 | ||
| 67890 | 1 | 2 | ||
| 67890 | 1 | 2 | ||
| 12345 | 2 | 2 | ||
| 12345 | 2 | 2 | ||
| 67890 | 2 | 1 |
I've tried
Weekly Total= CALCULATE( DISTINCTCOUNT(tRaw[ZIP]), ALLEXCEPT(tRaw,tRaw[Week]) )
but what ends up coming out is
| ZIP | Week | Weekly Total | ||
| 12345 | 1 | 5 | ||
| 12345 | 1 | 5 | ||
| 12345 | 1 | 5 | ||
| 67890 | 1 | 5 | ||
| 67890 | 1 | 5 | ||
| 12345 | 2 | 3 | ||
| 12345 | 2 | 3 | ||
| 67890 | 2 | 3 |
Any help would be appreciated!
Solved! Go to Solution.
Figured it out
Don't need DISTINCTCOUNT, COUNT worked perfectly
Hi,
You should do a COUNT not a DISTINCTCOUNT, which prevents you from havnig the expected result.
Both solutions hereunder, would do the trick :
As @parry2k proposed :
Weekly Total v2 =
CALCULATE(
COUNT(tRaw[ZIP]),
ALLEXCEPT(tRaw,tRaw[Week],tRaw[ZIP])
)Or if you like to have another version of the solution, you could do :
Weekly Total v1 =
CALCULATE(
COUNT(tRaw[ZIP]),
KEEPFILTERS(tRaw[Week]), KEEPFILTERS(tRaw[ZIP])
)Both soltions provides expected results. Let us know...
Hi @Anonymous
I am so glad that you have solved your problem , please consider Accept it as the solution to help the other members find it more quickly.
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous you should add Zip column in ALLEXCEPT too:
Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Figured it out
Don't need DISTINCTCOUNT, COUNT worked perfectly
Like so?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 64 | |
| 45 | |
| 41 | |
| 36 | |
| 23 |
| User | Count |
|---|---|
| 192 | |
| 125 | |
| 106 | |
| 78 | |
| 53 |