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 team
I'm a beginner in PowerBi and I need to build something that is too complex for me:
using PowerQuery I've got a table with
invoice number,
customer,
date of issue
date payment (when the invoice was paid (empty if not paid))
I need to create a report:
how many invoices were unpaid at the end of every week (Sunday), grouped by Customer?
for example
| #week | customer | # unpaid invoices | |
| 2023-week12 | alfa | 10 | |
| 2023-week12 | beta | 2 | |
| 2023-week13 | alfa | 3 | |
| 2023-week13 | beta | 20 |
could you please help me ?
Thank you in advance
Solved! Go to Solution.
Hi @Mike1309
the week column should be part of a disconnected 'Date' table.
Unpaid Orders =
VAR MaxDate =
MAX ( 'Date'[Date] )
RETURN
COUNTROWS (
FILTER (
'Table',
'Table'[date of issue] <= MaxDate
&& COALESCE ( 'Table'[date payment], TODAY () ) > MaxDate
)
)
Hi @Mike1309
the week column should be part of a disconnected 'Date' table.
Unpaid Orders =
VAR MaxDate =
MAX ( 'Date'[Date] )
RETURN
COUNTROWS (
FILTER (
'Table',
'Table'[date of issue] <= MaxDate
&& COALESCE ( 'Table'[date payment], TODAY () ) > MaxDate
)
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 31 | |
| 20 | |
| 12 | |
| 12 |