Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is this possible to be done in powerbi?
Example in forecasting:
In 2020 I have 50, dashboard filter 5% to the number for the following forecast years.
Start of forcasting and the expected result:
in
2020: 50
2021 : 50-(50*0.05) = 48
2022: 48 - (48*0.05) = 46
2023: 46 - (46*0.05) = 44
.
.
2025
Solved! Go to Solution.
Hi @thekimberlytan ,
According to your description, you could create what-if parameter, then create measure (based on the what-if parameter); the following formula to create a measure :
Step 1: Add what-if parameter(Percentage)
Step2: Add measure(Value)
Value =
VAR _a =
MAX ( 'Table'[Year] ) - 2020
RETURN
CALCULATE (
MAX ( 'Table'[Sales] ) * ( 1 - [Percentage Value] ) ^ _a,
ALL ( 'Table' )
)
The final output is shown below:
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You could modify the measure by the following:
value =
VAR _a =
MAX ( 'Table'[Year] ) - 2020
RETURN
CALCULATE (
MAX ( 'Table'[Sales] ) * ( 1 - [Percentage Value] + [scenario Value] ) ^ _a,
ALL ( 'Table' )
)
The final output is shown below:
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @thekimberlytan ,
According to your description, you could create what-if parameter, then create measure (based on the what-if parameter); the following formula to create a measure :
Step 1: Add what-if parameter(Percentage)
Step2: Add measure(Value)
Value =
VAR _a =
MAX ( 'Table'[Year] ) - 2020
RETURN
CALCULATE (
MAX ( 'Table'[Sales] ) * ( 1 - [Percentage Value] ) ^ _a,
ALL ( 'Table' )
)
The final output is shown below:
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-yalanwu-msft, thanks for your solution!!
what if the scenario is like - i have 2 what-if parameters, attrition 5% and recruitment 3%
2020:52
2021: 52- (52*5%)+(52*3%) = 51
2022: 51-(51*5%)+(51*3%) = N
20233:N-(N*5%)+(51*3%)=N
.
.
You could modify the measure by the following:
value =
VAR _a =
MAX ( 'Table'[Year] ) - 2020
RETURN
CALCULATE (
MAX ( 'Table'[Sales] ) * ( 1 - [Percentage Value] + [scenario Value] ) ^ _a,
ALL ( 'Table' )
)
The final output is shown below:
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @CNENFRNL, thanks for your input.
My Question - if the 5% is based on the what-if parameter, can it still be populate using the script you share?
@thekimberlytan , simply an algbra question,
f(n)=f(n-1)*(1-0.05)=f(n-2)*(1-0.05)^2= ... =f(0)*0.95^n
let
Source = Table.FromList({2020..2025}, Splitter.SplitByNothing(), {"Yr"}),
Yr2020 = 50,
#"Added Custom" = Table.AddColumn(Source, "Forecast_PQ", each Number.RoundUp(Yr2020 * Number.Power(.95, [Yr]-2020)))
in
#"Added Custom"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |