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 ,
There is a measure
Unpaid Invoice Days =
VAR _tbl =
FILTER (
ADDCOLUMNS (
SUMMARIZE (
Debt;
Debt[DocumentNo];
Debt[KeyCode];
Debt[PaymentDate]
);
"Saldo"; CALCULATE ( SUM ( Debt[Amount] ) );
"InvoiceDate"; CALCULATE ( MAX ( Debt[DocumentDate] ) ) //For knowing which Date Invoice is unpaid
);
[Saldo] > 0 // to filter Unpaid Invoices
)
VAR _min = MINX ( _tbl; [InvoiceDate] )
VAR _max = MAXX ( _tbl; [InvoiceDate] )
RETURN
CALCULATE (
DATEDIFF ( _min; _max; DAY );
FILTER (
ALL ( 'Calendar'[Date] );
'Calendar'[Date] >= MAX ( 'Calendar'[Date] )
)
)
It working fine, but when i put it with Calendar[Date] column it filter's my _tbl rows. I tried to wrap DATEDIFF ( _min; _max; DAY ) function with CALCULATE FILTER ALL pattern, but it dont work. What is wrong ?
pbix Sample file - https://1drv.ms/u/s!Ag3StL_v1twMoVIBrE0WPgoN3QT4?e=4MbQ5h
Thank You
Hi @vytas ,
Did you have relationship between two tables or how did you design you table? If possible, could you please inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dax ,
There is sample data file. All information is in there. https://1drv.ms/u/s!Ag3StL_v1twMoVIBrE0WPgoN3QT4?e=3vAIMv
Thank You in advance
Difficult to tell. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |