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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Measure to get the Cumulative Unreleased Orders

Could you please help. 

 

We are getting orders in sales department which need to be checked and released to production. There is order ID, value, order date and a flag whether it got released or not and the release date.

 

Order Date and Release Date are linked to Date Table with Order date as active and Release date as inactive releationship.

 

Order IDOrder ValueOrder Date (Linked to Date Table) - ActiveIsReleasedRelease Date (Linked to Date Table) - InActive)
110001-01-2023104-01-2023
280005-01-2023  
390008-01-2023115-01-2023
440005-02-2023108-02-2023
560015-02-2023122-02-2023
630020-02-2023123-02-2023
770001-03-2023  
880005-03-2023  
950010-03-2023  
1040015-03-2023120-03-2023
1190030-03-2023  
1250005-04-2023110-04-2023
1360010-04-2023  
1450015-04-2023120-04-2023
1580025-04-2023  

 

Expecting the below cumulative unreleased order results to be populated in a chart.

Please support with DAX.

 

DateUnReleased Order Value
01-01-2023100
02-01-2023100
03-01-2023100
04-01-20230
05-01-2023800
06-01-2023800
07-01-2023800
08-01-20231700
09-01-20231700
10-01-20231700
11-01-20231700
12-01-20231700
13-01-20231700
14-01-20231700
15-01-2023800

 

On Jan 1st we got a order for 100$ and so the unrleased order value is 100 and it continues for next 4 days till it got released on Jan 4th and therefore the unreleased order value comes to 0 agian.

 

On Jan 5th we got order for 800$ and  it is not relased yet and on Jan 8th we got order for 900$ and so the total cumulative unreleased order value is 1700$ and it goes on till some orders gets added or some orders get relased.

 

Here I have given results till Jan 15. But in business scenario the data goes on for years and years. Please help with DAX for getting this cumulative values.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous,

have created a simple sample , please refer to my  pbix file to see if it helps you.

Create a calendar date. Then merge the 2 tables.

From the “Get data” drop-down menu, select “Blank Query”. This will open the Power Query Editor window where you will build the table.

Create a list of dates using the formula bar. 

 

= List.Dates(#date(2023,1,1),365,#duration(1,0,0,0))

Then convert the List into a table by clicking the “To Table” button in the Convert menu on the ribbon. You will not make any selections r in the subsequent window, click “OK”.

Once the List has been converted to a Table, rename the column to “Date Value” and change the data type to a Date type using the data type button next to the column header.

More details about How to Create a Date Table 

 

Then merge the two tables.

vrongtiepmsft_4-1685932208204.png

Then create a measure.

result= 
VAR _1 =
    CALCULATE (
        SUM ( Merge1[Order Value]),
        FILTER (
            ALLSELECTED ( Merge1 ),
           Merge1[Query1.date] <= MAX (Merge1[Query1.date] )
                && Merge1[Attribute] <> "Release Date (Linked to Date Table) - InActive)"
        )
    )
VAR _2 =
    CALCULATE (
        SUM ( Merge1[Order Value]),
        FILTER (
            ALLSELECTED ( Merge1 ),
           Merge1[Query1.date] <= MAX (Merge1[Query1.date] )
                && Merge1[Attribute]  = "Release Date (Linked to Date Table) - InActive)"
        )
    )
RETURN
 _1-_2

vrongtiepmsft_5-1685932248090.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,

have created a simple sample , please refer to my  pbix file to see if it helps you.

Create a calendar date. Then merge the 2 tables.

From the “Get data” drop-down menu, select “Blank Query”. This will open the Power Query Editor window where you will build the table.

Create a list of dates using the formula bar. 

 

= List.Dates(#date(2023,1,1),365,#duration(1,0,0,0))

Then convert the List into a table by clicking the “To Table” button in the Convert menu on the ribbon. You will not make any selections r in the subsequent window, click “OK”.

Once the List has been converted to a Table, rename the column to “Date Value” and change the data type to a Date type using the data type button next to the column header.

More details about How to Create a Date Table 

 

Then merge the two tables.

vrongtiepmsft_4-1685932208204.png

Then create a measure.

result= 
VAR _1 =
    CALCULATE (
        SUM ( Merge1[Order Value]),
        FILTER (
            ALLSELECTED ( Merge1 ),
           Merge1[Query1.date] <= MAX (Merge1[Query1.date] )
                && Merge1[Attribute] <> "Release Date (Linked to Date Table) - InActive)"
        )
    )
VAR _2 =
    CALCULATE (
        SUM ( Merge1[Order Value]),
        FILTER (
            ALLSELECTED ( Merge1 ),
           Merge1[Query1.date] <= MAX (Merge1[Query1.date] )
                && Merge1[Attribute]  = "Release Date (Linked to Date Table) - InActive)"
        )
    )
RETURN
 _1-_2

vrongtiepmsft_5-1685932248090.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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