Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello all.
I have a table that shows me the sales revenue per item per month.
| Item | Sales | Month | AVG Sales Order Size |
| ABC | 500 | January | 500 |
| ABC | 200 | February | 500 |
| ABC | 300 | March | 500 |
| DEF | 200 | January | 400 |
| DEF | 200 | February | 400 |
In the last column you can find the average sales order size.
Now I would like to get the number of Sales Order based on DIVIDE ([SALES], [AVG Sales Order Size]), but just integers, that are rounded down. If it is rounded down, then the value should be summed up until the next integer was reached.
It should look like that:
| Month | Item | AVG Sales Size | Sales | # Sales | Adjusted running total |
| January | ABC | 500 | 500 | 1 | 500 |
| February | ABC | 500 | 300 | 0 | 300 |
| March | ABC | 500 | 200 | 1 | 500 |
| April | ABC | 500 | 300 | 0 | 300 |
| May | ABC | 500 | 200 | 1 | 500 |
| June | ABC | 500 | 400 | 0 | 400 |
| July | ABC | 500 | 200 | 1 | 600 |
| August | ABC | 500 | 500 | 1 | 600 |
| September | ABC | 500 | 800 | 0 | 900 |
| October | ABC | 500 | 600 | 2 | 1000 |
| November | ABC | 500 | 3200 | 6 | 3200 |
| December | ABC | 500 | 300 | 0,8 | 400 |
| 7500 | 13,8 |
If the number of sales divided by AVG Sales Size is not an integer, then the difference is summed up until the next integer was reached. But if an integer will never be reached, then is should display a decimal number as you can see in December
How is this possible in dax?
Hi, @joshua1990
I think this is hard to achieve in dax.
This kind of recursion is difficult to implement in DAX.
Best Regards,
Community Support Team _ Eason
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |