Forum Discussion
Subtract the column from a fixed value
- Anonymous3 years ago
Hi Junaid11 ,
Here is a measure that produces the precise table that you displayed in your question.
Outcome = VAR currentDate = SELECTEDVALUE('Table'[Date]) RETURN IF( HASONEVALUE('Table'[Date]), 9800 - CALCULATE( SUM('Table'[Ependiture]), 'Table'[Date] <= currentDate, ALLEXCEPT('Table','Table'[Date]) ) ,9800 - sum('Table'[Ependiture]) )The outcome is showed in the below picture.
There is a similar question which was answered by Chris Mendoza. Thanks for his contribution!
You can look it up through this link: Solved: Subtract the value by fixed value to get next subt... - Microsoft Fabric CommunityAdditional Tips:
In the future, if you have a various range of budgets, you may consider using the following step.
Go to Modeling ---- New Parameters ---- Numeric Range, and enter a range of numbers you would like to use as budget.
And then change the measure to a new version:Outcome = VAR currentDate = SELECTEDVALUE('Table'[Date]) VAR budget = SELECTEDVALUE('Table'[Budget]) RETURN IF( HASONEVALUE('Table'[Date]), [Parameter Value] - CALCULATE( SUM('Table'[Ependiture]), 'Table'[Date] <= currentDate, ALLEXCEPT('Table','Table'[Date]) ) ,[Parameter Value] - sum('Table'[Ependiture]) )Now the table will change if the parameter value changes.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Junaid11 ,
Here is a measure that produces the precise table that you displayed in your question.
Outcome =
VAR currentDate =
SELECTEDVALUE('Table'[Date])
RETURN
IF(
HASONEVALUE('Table'[Date]),
9800
- CALCULATE(
SUM('Table'[Ependiture]),
'Table'[Date] <= currentDate,
ALLEXCEPT('Table','Table'[Date])
)
,9800 - sum('Table'[Ependiture])
)
The outcome is showed in the below picture.
There is a similar question which was answered by Chris Mendoza. Thanks for his contribution!
You can look it up through this link: Solved: Subtract the value by fixed value to get next subt... - Microsoft Fabric Community
Additional Tips:
In the future, if you have a various range of budgets, you may consider using the following step.
Go to Modeling ---- New Parameters ---- Numeric Range, and enter a range of numbers you would like to use as budget.
And then change the measure to a new version:
Outcome =
VAR currentDate =
SELECTEDVALUE('Table'[Date])
VAR budget =
SELECTEDVALUE('Table'[Budget])
RETURN
IF(
HASONEVALUE('Table'[Date]),
[Parameter Value]
- CALCULATE(
SUM('Table'[Ependiture]),
'Table'[Date] <= currentDate,
ALLEXCEPT('Table','Table'[Date])
)
,[Parameter Value] - sum('Table'[Ependiture])
)
Now the table will change if the parameter value changes.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.