Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi
I am trying to create report with customer name their first invoice date and invoice amount. I have a customer table and invoice date and invoice tables.
I am using DAX
If tou just want to use measure. Try this.
First_Invoice_Date =
CALCULATE(
MIN('Invoice'[Invoice Date]),
ALLEXCEPT('Invoice', 'Invoice'[customer id])
)
First_Invoice_Amount =
VAR FirstDate = CALCULATE(
MIN('Invoice'[Invoice Date]),
ALLEXCEPT('Invoice', 'Invoice'[customer id])
)
RETURN
CALCULATE(
SUM('Invoice'[Invoice Amount]),
'Invoice'[Invoice Date] = FirstDate
)
|
create a calculated column in the invoice table.
first_date =
VAR A = CALCULATE(
MIN('Invoice'[Invoice Date]),
ALLEXCEPT('Invoice', 'Invoice'[customer id])
)
RETURN
IF(A = 'Invoice'[Invoice Date], 1, 0)
Use rhis column in the visual level filter and filter for 1.
this post helps, then please give us Kudos and consider accepting it as a solution to help other members find it more quickly.
Thank you bhanu_gautam and Yulia Xu for your inputs!
I have 3 tables under this scenario. This is MS Fabric and i don't have option to create new/custom column
Invoice Amount:
Net Amount | ||
Invoice Date
Invoice Date | creation date |
Customer
Name | Address | zip | Rep |
Life Financials | 20 Lincoln Ave | 51231 | Nicole |
State Electric | 500 Group Dr | 62312 | Jane |
Life Financials | 20 Lincoln Ave | 51231 | Nicole |
Yes, looking to display the first first record of each customer. Thanks!
Hi @BIEnthu
Thanks for the reply from bhanu_gautam .
BIEnthu , I have created a simple example data for testing, according to the test if there is a relationship between the two tables then every customer can get the earliest invoice date correctly, is there a relationship between your two tables? If my data structure is different from yours, could you please provide the sample data about both tables so that we can help you better? How to provide sample data in the Power BI Forum - Microsoft Fabric Community Please remove any sensitive data in advance.
My sample:
If there is no relationship between the two tables, the result will not be what you need.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@BIEnthu Create a calculated column for the first invoice date:
FirstInvoiceDate =
CALCULATE(
MIN('Invoice'[Invoice Date]),
ALLEXCEPT('CustomerTable', 'CustomerTable'[Customer Name])
)
Create a calculated column for the first invoice amount:
FirstInvoiceAmount =
CALCULATE(
FIRSTNONBLANK('Invoice'[Invoice Amount], 1),
FILTER(
'Invoice',
'Invoice'[Invoice Date] = EARLIER('CustomerTable'[FirstInvoiceDate])
)
)
Create a summary table to display the results:
CustomerFirstInvoiceSummary =
SUMMARIZE(
'CustomerTable',
'CustomerTable'[Customer Name],
'CustomerTable'[FirstInvoiceDate],
'CustomerTable'[FirstInvoiceAmount]
)
Proud to be a Super User! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
21 | |
17 | |
16 | |
11 | |
7 |
User | Count |
---|---|
26 | |
25 | |
12 | |
12 | |
12 |