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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Trolleri
Helper I
Helper I

Rank by date and quantity

Hello,

 

Im trying to make a que list by ranking order date and quantity that i will match with available quantity, so if i have 4 available units i will give those to the first 3 orders, since the third order in the example has ordered 2. I have managed to rank the orders by date but cant wrap my head around how to make it consider the quantity in each order.

 

Expected behaviour of the rank column:

Order idOrder dateproductquantityrank
2456772021-11-25 4567711
2467772021-11-26 4567712
2788992021-11-27 4567724
2946782021-11-28 4567715
1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @Trolleri ,

Please have a try.

Create a measure.

Measure = CALCULATE(SUM('Table'[quantity]),FILTER(ALL('Table'),'Table'[Order date]<=MAX('Table'[Order date])))

11.PNG

Best Regards

Community Support Team _ Polly

 

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

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @Trolleri ,

Please have a try.

Create a measure.

Measure = CALCULATE(SUM('Table'[quantity]),FILTER(ALL('Table'),'Table'[Order date]<=MAX('Table'[Order date])))

11.PNG

Best Regards

Community Support Team _ Polly

 

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

amitchandak
Super User
Super User

@Trolleri , This seem like cumulative Qty

new measure

=sumx(filter( allselected(Table), Table[Date] <= max(Table[Date]) ), [Quantity] )

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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