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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Create Measure: Calculates the date when 60% of ordered volume will have shipped, by product.

Hi,

 

I'm currently importing data that shows units on order, into Powerbi. 

 

I'd like to create a measure that calculates the ship date of a specific item, based on a % of total "units on order" for that item.

 

As an example, using the table below as my source data. I'd like to calculate, in a new table without the "account" column, the date for which at least 60% of the sum of units for each product will have shipped.

 

AccountProductUnits on OrderShipped Date
Jims HardwareHammer502024-09-13
MarksHammer102024-11-25
J&JHammer302024-02-25
Eagle ClubHammer192024-10-13
Jims HardwareScrewdriver1002024-09-13
Eagle ClubScrewdriver5002024-10-10
J&JScrewdriver702024-05-10
J&JScrewdriver252024-12-15
MarksScrewdriver4002024-07-15
Jims HardwareHammer502024-12-16
MarksHammer102024-02-17
Eagle ClubHammer302024-12-18
MarksHammer192024-06-19
Jims HardwareScrewdriver1002024-08-20
Home and YardScrewdriver52024-12-21
Eagle ClubScrewdriver702024-09-22
J&JScrewdriver252024-12-23
Eagle ClubScrewdriver4002024-05-24
Home and YardHammer302024-12-01
MarksHammer192024-06-26
J&JHammer1002024-09-27
Eagle ClubHammer692024-12-28
Home and YardScrewdriver702024-12-29
Home and YardScrewdriver502024-09-30
J&JScrewdriver102024-12-31
Eagle ClubScrewdriver302025-01-01
Eagle ClubScrewdriver502025-01-02

 

ProductUnits on OrderDate (60% of Units Shipped)
Hammer436 
Screwdriver1905 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

You can modify it to the following dax:

Measure =
var _table1=
ADDCOLUMNS(
    'Test_Table',
    "Sum_Group",
    SUMX(FILTER(ALL('Test_Table'),'Test_Table'[Product]=EARLIER('Test_Table'[Product])),[Units on Order])*0.6,
    "Cum",    SUMX(FILTER(ALL('Test_Table'),'Test_Table'[Product]=EARLIER('Test_Table'[Product])&&'Test_Table'[Shipped Date]<=EARLIER('Test_Table'[Shipped Date])),[Units on Order]))
var _table2=
ADDCOLUMNS(
    _table1,
    "Date",MINX(FILTER(_table1,[Product]=EARLIER([Product])&&[Cum]>=[Sum_Group]),[Shipped Date]))
return
MAXX(
    FILTER(_table2,[Product]=MAX('New Table'[Product])),[Date])

vyangliumsft_0-1730182003989.png

 

Best Regards,

Liu Yang

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

6 REPLIES 6
Anonymous
Not applicable

Hi  @Anonymous ,

 

You can modify it to the following dax:

Measure =
var _table1=
ADDCOLUMNS(
    'Test_Table',
    "Sum_Group",
    SUMX(FILTER(ALL('Test_Table'),'Test_Table'[Product]=EARLIER('Test_Table'[Product])),[Units on Order])*0.6,
    "Cum",    SUMX(FILTER(ALL('Test_Table'),'Test_Table'[Product]=EARLIER('Test_Table'[Product])&&'Test_Table'[Shipped Date]<=EARLIER('Test_Table'[Shipped Date])),[Units on Order]))
var _table2=
ADDCOLUMNS(
    _table1,
    "Date",MINX(FILTER(_table1,[Product]=EARLIER([Product])&&[Cum]>=[Sum_Group]),[Shipped Date]))
return
MAXX(
    FILTER(_table2,[Product]=MAX('New Table'[Product])),[Date])

vyangliumsft_0-1730182003989.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thanks for the reply from ryan_mayu  and Kedar_Pande , please allow me to provide another insight: 
Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated table.

New Table =
SUMMARIZE('Test_Table',[Product],"Sum",SUMX('Test_Table',[Units on Order]))

vyangliumsft_0-1729837511118.png

2. Create measure.

Measure =
var _table1=
ADDCOLUMNS(
    'Test_Table',
    "Sum_Group",
    SUMX(FILTER(ALL('Test_Table'),'Test_Table'[Product]=EARLIER('Test_Table'[Product])),[Units on Order])*0.6,
    "Cum",    SUMX(FILTER(ALL('Test_Table'),'Test_Table'[Product]=EARLIER('Test_Table'[Product])&&'Test_Table'[Shipped Date]<=EARLIER('Test_Table'[Shipped Date])),[Units on Order]))
var _table2=
ADDCOLUMNS(
    _table1,
    "Date1",
    CONCATENATEX(
        FILTER(
            _table1,[Product]=EARLIER([Product])&&[Cum]<=[Sum_Group]),[Shipped Date],"-"))
return
MAXX(
    FILTER(_table2,[Product]=MAX('New Table'[Product])),[Date1])

3. Result:

vyangliumsft_1-1729837511119.png

 

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Hi, your result provides multiple dates per item. I'm trying to get to a singular result by item. The date result should equal the first date when 60% of TOTAL units on order each item have shipped.

Kedar_Pande
Super User
Super User

@Anonymous 

Create measures:

TotalUnitsOnOrder = SUM('YourTable'[Units on Order])
CumulativeShippedUnits = CALCULATE( SUM('YourTable'[Units on Order]), FILTER( 'YourTable', 'YourTable'[Shipped Date] <= MAX('YourTable'[Shipped Date]) ) )
ShipDateAt60Percent = VAR TotalUnits = [TotalUnitsOnOrder] VAR TargetUnits = TotalUnits * 0.6 RETURN CALCULATE( MIN('YourTable'[Shipped Date]), FILTER( 'YourTable', [CumulativeShippedUnits] >= TargetUnits ) )

create a new table that summarizes the results without the "Account" column:

SummaryTable = SUMMARIZE( 'YourTable', 'YourTable'[Product], "Date (60% of Units Shipped", [ShipDateAt60Percent] )

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Anonymous
Not applicable

Unfortunately this doesn not return accurate results.

ryan_mayu
Super User
Super User

the second table is just sum the units from the first table.

What 's the expected output based on the sample data you provided?

 





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

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors