Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi All,
year | actual | actual modelled |
2021 | 100 | |
2022 | 200 | |
2023 | ||
2024 | ||
2025 | ||
2026 |
I'm hoping you can help me. I have this table with 3 columns.
actual modelled will be my calculated column. What I need this column to do is from 2023 add 10 on to each value. The result is that it would look something like this
year | actual | actual modelled |
2021 | 100 | |
2022 | 200 | |
2023 | 210 | |
2024 | 220 | |
2025 | 230 | |
2026 | 240 |
really appreciate your help
Solved! Go to Solution.
Hi @wrigh2uk , you have 2 options. Calculated column:
actual modelled cln =
VAR tableWithValue =
FILTER ( VALUES ( 'Table'[actual] ), 'Table'[actual] <> BLANK () )
VAR maxYearWithValue =
CALCULATE ( MAX ( 'Table'[year] ), tableWithValue, ALL ( 'Table' ) )
VAR maxValue =
CALCULATE (
MAX ( 'Table'[actual] ),
'Table'[year] = maxYearWithValue,
ALL ( 'Table' )
)
VAR res = maxValue + ( 'Table'[year] - maxYearWithValue ) * 10
RETURN
IF ( 'Table'[actual] = BLANK (), res )
Measure:
actual modelled msr =
VAR maxYearWithValue =
CALCULATE (
MAX ( 'Table'[year] ),
ALL ( 'Table' ),
'Table'[actual] <> BLANK ()
)
VAR maxValue =
CALCULATE (
MAX ( 'Table'[actual] ),
'Table'[year] = maxYearWithValue,
ALL ( 'Table' )
)
VAR res = maxValue + ( SELECTEDVALUE ( 'Table'[year] ) - maxYearWithValue ) * 10
RETURN
IF (
ISINSCOPE ( 'Table'[year] ) && SELECTEDVALUE ( 'Table'[actual] ) = BLANK (),
res
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hi @wrigh2uk , you have 2 options. Calculated column:
actual modelled cln =
VAR tableWithValue =
FILTER ( VALUES ( 'Table'[actual] ), 'Table'[actual] <> BLANK () )
VAR maxYearWithValue =
CALCULATE ( MAX ( 'Table'[year] ), tableWithValue, ALL ( 'Table' ) )
VAR maxValue =
CALCULATE (
MAX ( 'Table'[actual] ),
'Table'[year] = maxYearWithValue,
ALL ( 'Table' )
)
VAR res = maxValue + ( 'Table'[year] - maxYearWithValue ) * 10
RETURN
IF ( 'Table'[actual] = BLANK (), res )
Measure:
actual modelled msr =
VAR maxYearWithValue =
CALCULATE (
MAX ( 'Table'[year] ),
ALL ( 'Table' ),
'Table'[actual] <> BLANK ()
)
VAR maxValue =
CALCULATE (
MAX ( 'Table'[actual] ),
'Table'[year] = maxYearWithValue,
ALL ( 'Table' )
)
VAR res = maxValue + ( SELECTEDVALUE ( 'Table'[year] ) - maxYearWithValue ) * 10
RETURN
IF (
ISINSCOPE ( 'Table'[year] ) && SELECTEDVALUE ( 'Table'[actual] ) = BLANK (),
res
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
This was perfect for what I needed. Thank you very much
You can use the following measure
actual modelled =
VAR BaseValue = 200 // The initial value for the year 2022
VAR YearDifference = YEAR('YourTable'[Year]) - 2022 // Calculate the difference from 2022
RETURN
IF( YearDifference > 0, // Check if it's 2023 or later
BaseValue + (YearDifference * 10), // Add 10 for each year beyond 2022
BLANK() // Leave earlier years blank
)
Thanks for your reply.
as a measure this doesn't work as the VAR YearDifference needs to be a aggregate function (when I try and find the field name it says cannot find otherwise). This would also go for VAR BaseValue as i can't really have this as static value.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
45 | |
42 | |
23 | |
22 | |
21 |