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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
snaraya
Helper II
Helper II

Need help to rectify the formula

Hi All,

i am calculating a formula where 
CurrentAmount / (CurrentAmount + NextAmount) * 1000000 

example: 0.1/(0.1+59.9)*1000000 =1666.66

 

 
the test column formula is : 
test =
VAR CurrentID = Table1[ID]
VAR CurrentAmount = Table1[Planned]
VAR NextAmount =
CALCULATE(
MAX(Table1[Planned]),
FILTER(
Table1,
Table1[ID] = CurrentID &&
Table1[Index] = EARLIER(Table1[Index]) + 1
)
)
RETURN
IF(
ISBLANK(NextAmount),
BLANK(),
CurrentAmount / (CurrentAmount + NextAmount) * 1000000
)

  000165 i should get 1666.66 but i am getting 1714

  000162 i am getting correct 


please somebody check what am i doing wrong
Thanks in advance

Adding table in the comment

1 ACCEPTED SOLUTION
snaraya
Helper II
Helper II

Issue got resolved, formula i used is correct . Only issue was because the planned column was not rounded off at query editor level causing output to be wrong . Thankyou 

View solution in original post

3 REPLIES 3
snaraya
Helper II
Helper II

Issue got resolved, formula i used is correct . Only issue was because the planned column was not rounded off at query editor level causing output to be wrong . Thankyou 

v-yaningy-msft
Community Support
Community Support

Hi, @snaraya 

You can refer to @Rupak_bi  reply, if it does not work, you can provide pbix files without sensitive data for testing(By Google Drive).

 

Best Regards,
Yang
Community Support Team

Rupak_bi
Post Prodigy
Post Prodigy

Hi , change your filter expression..

VAR NextAmount =
CALCULATE(
MAX(Table1[Planned]),
FILTER(

Allexcept(
Table1,
Table1[ID]

)
Table1[Index] = (Table1[Index]) + 1
)
)



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.