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
PowerBI123456
Post Partisan
Post Partisan

Payment Date After Note Date

Hi, I have 2 tables, notes and payments. I am trying to see which notes had a payment date after the note date Here is the sample model: Sample File 

 

PowerBI123456_0-1615500359188.png

 

Here is what I want it to look like. I am dealing 10million+ rows so if possible in an efficient measure. Thank you!!

PowerBI123456_1-1615500937603.png

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @PowerBI123456 

 

You may create a calculated column and measures as below. The pbix file is attached in the end.

Calculated column:

Flag Column = 
var postdate = 
CALCULATE(
    MAX('FACT: Payment'[Post Date]),
    FILTER(
        ALL('FACT: Payment'),
        [Account]=EARLIER('FACT: Notes'[Account])
    )
)
return
IF(
    postdate>[Note Date],
    1,0
)

 

Measure:

Flag Measure = 
var postdate = 
CALCULATE(
    MAX('FACT: Payment'[Post Date]),
    FILTER(
        ALL('FACT: Payment'),
        [Account]=MAX('FACT: Notes'[Account])
    )
)
return
IF(
    postdate>MAX([Note Date]),
    1,0
)
PostDate = 
CALCULATE(
    MAX('FACT: Payment'[Post Date]),
    FILTER(
        ALL('FACT: Payment'),
        [Account]=MAX('FACT: Notes'[Account])
    )
)

 

Result:

b1.png

 

Best Regards

Allan

 

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

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @PowerBI123456 

 

You may create a calculated column and measures as below. The pbix file is attached in the end.

Calculated column:

Flag Column = 
var postdate = 
CALCULATE(
    MAX('FACT: Payment'[Post Date]),
    FILTER(
        ALL('FACT: Payment'),
        [Account]=EARLIER('FACT: Notes'[Account])
    )
)
return
IF(
    postdate>[Note Date],
    1,0
)

 

Measure:

Flag Measure = 
var postdate = 
CALCULATE(
    MAX('FACT: Payment'[Post Date]),
    FILTER(
        ALL('FACT: Payment'),
        [Account]=MAX('FACT: Notes'[Account])
    )
)
return
IF(
    postdate>MAX([Note Date]),
    1,0
)
PostDate = 
CALCULATE(
    MAX('FACT: Payment'[Post Date]),
    FILTER(
        ALL('FACT: Payment'),
        [Account]=MAX('FACT: Notes'[Account])
    )
)

 

Result:

b1.png

 

Best Regards

Allan

 

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

Hello, sorry. How can I make that the 1 is glued only to the last date of management, and that if the account is managed on May 16, May 19 and May 26, and payment on May 17 and May 27 I stick the 1 only to the procedures of May 16 and 26 since they are those that would be taken as fulfilled since in the management of May there is no payment.

pranit828
Community Champion
Community Champion

Hi @PowerBI123456 

Create a new column 

check = IF(Payment[Post Date] > Notes[Note Date],1,0)

 

Now filter on the check column to show only 1





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi - what table should I create that column in?

@pranit828  Thanks! Anyway to do in a measure instead of a column?

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.