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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SSJ011
Frequent Visitor

Invoice and Credit notes details as per Sales person

Good Day, 

 

i have 2 tables one is for invoice and Credit notes with creations dates

 

Customer IDCreation DateCredit NotesInvoicesSystem
331S300145304-Oct-2101SAM
331S300145307-Sep-2101SAM
331S300145307-Feb-2101SAM
331C500384517-Feb-2111SAM
128200607-Jul-2101SAM
128200611-Jan-2101SAM
331C500384521-Mar-2111SAM
331C500384504-Apr-2101SAM
331C500384505-Jun-2101SAM
331C500384504-Oct-2111SAM
331C500384515-Nov-2101SAM
331C500384515-Nov-2101SAM
331C500384515-Dec-2111SAM
331C000058904-Oct-2101SAM
128200604-Oct-2101SAM
128200604-Nov-2111SAM
128200604-Nov-2101SAM
331C000058904-Nov-2111SAM

 

2nd table is of sales person with the contract period 

Customer IDSystemSales PersonContract Period StartContract Period End
1282006SAMSSJ01101-Jan-2131-Oct-21
1282006SASSSJ01101-Jan-2131-Oct-21
1282006SEMSSJ01101-Jan-2131-Oct-21
331C0000589SAMSSJ01101-Jan-2131-Oct-21
331C0000589SEMSSJ01101-Jan-2131-Oct-21
331C5003845SAMSGK00601-Jan-2131-Oct-21
331C5003845SASSGK00601-Jan-2131-Oct-21
331S3001453SAMNPA12401-Jan-2131-Oct-21
331S3001453SASNPA12401-Jan-2131-Oct-21
331S3001453SEMNPA12401-Jan-2131-Oct-21
1282006SAMSGK00601-Nov-2131-Dec-22
1282006SASSGK00601-Nov-2131-Dec-22
1282006SEMSGK00601-Nov-2131-Dec-22
331C0000589SAMSGK00601-Nov-2131-Dec-22
331C0000589SEMSGK00601-Nov-2131-Dec-22
331C5003845SAMTPO04801-Nov-2131-Dec-22
331C5003845SASTPO04801-Nov-2131-Dec-22
331S3001453SAMTPO04801-Nov-2131-Dec-22
331S3001453SASTPO04801-Nov-2131-Dec-22
331S3001453SEMTPO04801-Nov-2131-Dec-22

Common factores in both table are Customer ID , date and system.

My requirement is how can i get the invoce and credit notes for sales persons.

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @SSJ011 ,

 

Please try to create measure like below:

Invoices = CALCULATE(SUM('Table'[Invoices]),FILTER('Table','Table'[Customer ID]=MAX('Table (2)'[Customer ID])&&'Table'[System]=MAX('Table (2)'[System])&&'Table'[Creation Date]>=MAX('Table (2)'[Contract Period Start])&&'Table'[Creation Date]<=MAX('Table (2)'[Contract Period End])))

Vlianlmsft_0-1643091182888.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @SSJ011 ,

 

Please try to create measure like below:

Invoices = CALCULATE(SUM('Table'[Invoices]),FILTER('Table','Table'[Customer ID]=MAX('Table (2)'[Customer ID])&&'Table'[System]=MAX('Table (2)'[System])&&'Table'[Creation Date]>=MAX('Table (2)'[Contract Period Start])&&'Table'[Creation Date]<=MAX('Table (2)'[Contract Period End])))

Vlianlmsft_0-1643091182888.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SSJ011
Frequent Visitor

please any one can assiste me on this... 

freginier
Solution Specialist
Solution Specialist

Common factores are Customer, date and system so you can create relation only on these fields... 

Date iS in one table and we have a range where sales person was handling that customer . hence i need to calculate invoice and credit notes as per sales person

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.