Forum Discussion
Calendar Date Context
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
3 Replies
- Greg_DecklerCommunity Champion
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
- daxCommunity Support
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 ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- vytasHelper I
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