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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

DAX: Return values by matching different dates of columns

Hi all,


I have two columns Waterfall Date and Year Month.
Waterfall Date starts from the current month Jul-2021 until Dec-2022.
Year Month only includes the latest year month Jul-2021.

 

blueraccoon_1-1627963638534.png

blueraccoon_3-1627963665750.png

I'm trying to create a measure that would always return DP dollar for row items that are +1 month in the future (Waterfall date = Aug-2021, Year Month = Jul-2021).

Thanks all!

 

 

 

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

Hi @Anonymous ,

 

Create a measure as below:

Measure =
IF (
    MONTH ( MAX ( 'Table'[Year Month] ) ) = 12,
    CALCULATE (
        SUM ( 'Table'[DP dollar] ),
        FILTER (
            ALL ( 'Table' ),
            YEAR ( 'Table'[waterfall date] )
                = YEAR ( 'Table'[Year Month] ) + 1
                && MONTH ( 'Table'[waterfall date] ) = 1
        )
    ),
    CALCULATE (
        SUM ( 'Table'[DP dollar] ),
        FILTER (
            ALL ( 'Table' ),
            YEAR ( 'Table'[waterfall date] ) = YEAR ( 'Table'[Year Month] )
                && MONTH ( 'Table'[waterfall date] )
                    = MONTH ( 'Table'[Year Month] ) + 1
        )
    )
)

And you will see:

vkellymsft_0-1628142878164.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a measure as below:

Measure =
IF (
    MONTH ( MAX ( 'Table'[Year Month] ) ) = 12,
    CALCULATE (
        SUM ( 'Table'[DP dollar] ),
        FILTER (
            ALL ( 'Table' ),
            YEAR ( 'Table'[waterfall date] )
                = YEAR ( 'Table'[Year Month] ) + 1
                && MONTH ( 'Table'[waterfall date] ) = 1
        )
    ),
    CALCULATE (
        SUM ( 'Table'[DP dollar] ),
        FILTER (
            ALL ( 'Table' ),
            YEAR ( 'Table'[waterfall date] ) = YEAR ( 'Table'[Year Month] )
                && MONTH ( 'Table'[waterfall date] )
                    = MONTH ( 'Table'[Year Month] ) + 1
        )
    )
)

And you will see:

vkellymsft_0-1628142878164.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture) and show the expected outcome.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

October NL Carousel

Fabric Community Update - October 2024

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