Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Mike1309
Frequent Visitor

PowerBi not paid invoices

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-week12alfa10 
2023-week12beta2 
2023-week13alfa3 
2023-week13beta20 

  

 

could you please help me ?

Thank you in advance

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

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
)
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

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
)
)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.