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
Anonymous
Not applicable

MAX Record (with ALLEXCEPT) in ALLSELECTED FILTER CONTEXT

Hi Friends,

Let me explain my issue:

 

Each Invoice has many part payments and a seperate row appears for it. The closedate is the date payment came.

Running total Column - For each invoice - the order in which payment came.

Balance Amount Column - Balance amount as of Close date.


I created another table with only Start of month dates in it MonthStartDate[MonthStartDate] with 1-> many relationship on CloseDate.
01-04-2019
01-05-2019
01-06-2019

Problem statement -> Show outstanding (Total Balance amount) at 1st of each month
Approach ->
Step 1 -> Select all data before that 1st of month. The below measure gives all the rows for all the invoices and all payments.

CummulativeSUM 1 = CALCULATE( SUM('Outstanding Report'[BalanceAmount]), FILTER(
ALLSELECTED('Outstanding Report'),
'Outstanding Report'[CloseDate] < MAX(MonthStartDate[MonthStartDate])
) )

Step 2 - In the dataset of Step1, find the latest payment record for each Invoice. Means -> Pick the MAX (Running total) for each Invocie. Below Measure gives me max record in the WHOLE Data set
MaxRecord =
CALCULATE( MAX('Outstanding Report'[Running Total]), ALLEXCEPT('Outstanding Report', 'Outstanding Report'[Invoice]) )

PROBLEM : HOW do I combine Step1 & Step2.

 

Sample Dataset:

 

InvoiceInvdatCloseDateAmountReceivedBalanceAmountRunning Total
S52-1190001020-04-201920-04-20190125241
S52-1190001020-04-201920-06-2019-1252402
S52-1190001120-04-201920-04-20190573751
S52-1190001120-04-201922-05-2019-325570502
S52-1190001120-04-201922-04-2019-5500020503
S52-1190001120-04-201922-05-2019-205004
S52-1190001225-04-201925-04-2019022511
S52-1190001225-04-201925-05-2019-225012
S52-1190001225-04-201925-06-2019-103
S52-1190001325-04-201925-04-20190217351
S52-1190001325-04-201925-05-2019-2173502
S52-1190001426-04-201926-04-20190256741
S52-1190001426-04-201926-05-2019-250006742
S52-1190001426-04-201927-06-2019-67403
S54-1181441327-02-201927-02-20190336511
S54-1181441327-02-201927-04-2019-3364472
S54-1181460027-03-201927-03-20190295761
S54-1181460027-03-201927-04-2019-2957422
S56-1181010830-03-201930-03-20190339011
S56-1181010830-03-201912-04-2019-3390012
S56-1190000130-04-201930-04-20190194991
0 REPLIES 0

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.

Top Solution Authors