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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
joshua1990
Post Prodigy
Post Prodigy

Cumulate and display integers

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?

1 REPLY 1
v-easonf-msft
Community Support
Community Support

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.