Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Please help for below dax formula
I have sales order number and itme number qith quantity
SONO ITEMNO Quantity
1000 1 10
1000 2 20
1000 3 60
1000 4 20
1001 3 50
1001 5 30
I should get sum quantity for each salesorder based on last itemno called new order quantity
I should get sum quantity for each salesorder based on all itemnumbers avoiding max itemno called order quantity
in above case i need quantity for sono 1000 with max itemno 4 and for sono 1000 sum up all quantities from itemno 1 to 3
Solved! Go to Solution.
maybe you can try this
Measure 2 = CALCULATE(sum('Table (2)'[Quantity]),FILTER('Table (2)','Table (2)'[ITEMNO]=max('Table (2)'[ITEMNO])))
Measure 3 =
VAR _MAX=MAX('Table (2)'[ITEMNO])
RETURN CALCULATE(SUM('Table (2)'[Quantity]),FILTER('Table (2)','Table (2)'[ITEMNO]<_MAX))
Proud to be a Super User!
Could you tell me if your problem has been solved? If it is, kindly Accept the helpful reply as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou
maybe you can try this
Measure 2 = CALCULATE(sum('Table (2)'[Quantity]),FILTER('Table (2)','Table (2)'[ITEMNO]=max('Table (2)'[ITEMNO])))
Measure 3 =
VAR _MAX=MAX('Table (2)'[ITEMNO])
RETURN CALCULATE(SUM('Table (2)'[Quantity]),FILTER('Table (2)','Table (2)'[ITEMNO]<_MAX))
Proud to be a Super User!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
122 | |
101 | |
71 | |
61 |