Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hey, fellow Power Bi friends
I want to calculate the diffrence between the latest quantity and the earliest quanitity based on indexes
| index | item_quantity |
1 | 5 |
| 2 | 2 |
| 3 | 5 |
| 4 | 6 |
| 5 | 9 |
for example i want to know the diffrence between the item_qunaitity of the 1st index and the item_quanity of the 5th index whch is 80% ((9-5)/5)
All help will be much appreciated
Try this:
MeasureIndex =
VAR __minindex = CALCULATE(minx('Table','Table'[index]))
VAR __maxindex = CALCULATE(maxx('Table','Table'[index]))
VAR __maxindexvalue = CALCULATE(sumx(FILTER('Table','Table'[index]=__maxindex),'Table'[item_quantity ]))
VAR __minindexvalue = CALCULATE(sumx(FILTER('Table','Table'[index]=__minindex),'Table'[item_quantity ]))
RETURN (__maxindexvalue-__minindexvalue)/__minindexvalue
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 26 | |
| 22 | |
| 19 | |
| 17 | |
| 10 |