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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Be-ro92
Frequent Visitor

Continue Rolling Value by Month Until A New Value Appears

I would like to show a sales opportunity amount by month until a new amount appears to demonstrate the historical pipeline of sales opportunities.

Whether it's done via DAX or Power Query, any assistance would be greatly appreciated!

Thanks!

Opportunity Opportunity DatePipeline Amount
Opportunity 12023-04-01$5,000
 2023-05-01$5,000
 2023-06-01$5,000
Opportunity 12021-07-01$11,000
 2021-08-01$11,000
 2021-09-01$11,000
 2021-10-01$11,000
 2021-11-01$11,000
 2021-12-01$11,000
 2022-01-01$11,000
Opportunity 12022-02-28$12,000

 

1 ACCEPTED SOLUTION

Hi @Be-ro92 ,

I create a table as you mentioned.

vyilongmsft_0-1715845198614.png

Then I create a new table and here is the DAX code.

Table 2 =
VAR _vtable =
    FILTER (
        CROSSJOIN (
            'Table',
            FILTER (
                CALENDAR ( MIN ( 'Table'[Opportunity Date] ), MAX ( 'Table'[Nextdate] ) ),
                DAY ( [Date] ) = 1
            )
        ),
        [Date] >= 'Table'[Opportunity Date]
            && [Date] < 'Table'[Nextdate]
    )
RETURN
    SELECTCOLUMNS (
        ADDCOLUMNS (
            _vtable,
            "_outcome",
                IF (
                    MINX ( FILTER ( _vtable, [Index] = EARLIER ( [Index] ) ), [Date] ) = [Date],
                    [Opportunity Date],
                    [Date]
                )
        ),
        [Index],
        "Product Type", [Opportunity ],
        "Pipeline Date", [_outcome],
        "Pipeline amount", [Pipeline Amount]
    )

Finally you will get what you want.

vyilongmsft_1-1715845541138.png

 

 

 

Best Regards

Yilong Zhou

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

3 REPLIES 3
Be-ro92
Frequent Visitor

Here is a screenshot of what I am trying to achieve. Pipeline.png

Hi @Be-ro92 ,

I create a table as you mentioned.

vyilongmsft_0-1715845198614.png

Then I create a new table and here is the DAX code.

Table 2 =
VAR _vtable =
    FILTER (
        CROSSJOIN (
            'Table',
            FILTER (
                CALENDAR ( MIN ( 'Table'[Opportunity Date] ), MAX ( 'Table'[Nextdate] ) ),
                DAY ( [Date] ) = 1
            )
        ),
        [Date] >= 'Table'[Opportunity Date]
            && [Date] < 'Table'[Nextdate]
    )
RETURN
    SELECTCOLUMNS (
        ADDCOLUMNS (
            _vtable,
            "_outcome",
                IF (
                    MINX ( FILTER ( _vtable, [Index] = EARLIER ( [Index] ) ), [Date] ) = [Date],
                    [Opportunity Date],
                    [Date]
                )
        ),
        [Index],
        "Product Type", [Opportunity ],
        "Pipeline Date", [_outcome],
        "Pipeline amount", [Pipeline Amount]
    )

Finally you will get what you want.

vyilongmsft_1-1715845541138.png

 

 

 

Best Regards

Yilong Zhou

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

This formula is almost there. I noticed that from Jan 2022 to March 2022 that March 2022 does not appear.

And then there is no data from March 2022 to March of 2023.

How can I add this data in between those dates?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.