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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
dekings
Frequent Visitor

Taking the whole number and adding the decimal to the next row in DAX

Hi

Please I need help implementing this logic

I need help building a DAX function that takes

A numerical column,

Divides each by 21

from the result which is a float, return the whole number if the result has decimal number greater than 0,

then add the decimal number to the value in the next row

continue that way till the last row 

the last row will return both the whole number and the decimal

 

 

Here is a simple table that captures the problem I want to solve

 

Loadtonnagetrips
150.710
562.673
160.761
251.191
190.901
140.670
522.483
753.573.95

 

from the tonnage column 0.71 has 0 as the whole number, we return 0 and take the decimal .71 add it to second row, that 2.67 + 0.71 = 3.38.
return 3 which is the whole number and add .38 to the third row 0.76 + 0.38 = 1.14. again return 1 being the whole number and add .14 to the fourth row 1.19 + 0.14 = 1.33. return 1 and add .33 to the next row. in that order till the end of the row. the last row will return both the whole number and decimal in any.

 

Please help.

 

Thank you

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.