Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a fact table with Sales Invoices
Each transaction has the following fields:
DateOfTrans,
Amount,
Balance: live field - updated as and when payments are applied to it (=0 for payments),
DueDate, and
Last_paid_Date: Refers to the date of the last payment trans applied to a sales invoice =>If Balance = 0 this is the date the sales invoice was completely paid off
I am looking to calculate a snapshot view of average days a customer takes to pay off invoices (and then show aging of said DaystoPay over time) with the following logic:
1. If Balance = 0:
(a) Last_paid_Date < SelectedDate => DaystoPay = (Last_paid_Date - DateOfTrans)
(b) Last_paid_Date < SelectedDate => DaystoPay = (SelectedDate - DateOfTrans) (i.e. consider it unpaid as of selected date)
2. If Balance <> 0 => DaystoPay = (SelectedDate - DateOfTrans)
I am having troubles calculating this at a row level because DAX will only let me select fields as an aggregate value.
Pelase help
Hi @pt008
Please read this article if you want your question answered.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |