Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Experts
I want to amend the following DAX which gives me a forecast on my sales based on the last 3year with an uplift of 5% across all products.
I want to add and additional step into the DAX where Products (managed Services, professional Service) have a 7% and 8% uplift in sales for 2022 and sales for all other products are at 5%.
Solved! Go to Solution.
Hi @Anonymous ,
Sales Forecast =
VAR SALESLY =
CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -1, YEAR ) )
VAR SALES2LY =
CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -2, YEAR ) )
VAR SALES3LY =
CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -3, YEAR ) )
VAR Factor =
SWITCH(
TRUE(),
MAX( Table[service] ) = "Managed Services", 1.07,
MAX( Table[service] ) = "Professional Services", 1.08,
1.05
)
RETURN
DIVIDE( SALESLY + SALES2LY + SALES3LY, 3, 0 ) * Factor
result:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi AMit here is the expected end result
Service | Sales | Result | Uplift | |
Managed Service | 1 | 1.07 | 0.07 | |
Professional Service | 2 | 2.16 | 0.08 | |
New | 3 | 3.15 | 0.05 | |
old | 4 | 4.2 | 0.05 | |
Other | 5 | 5.25 | 0.05 | |
Not only MS and PS have an uplift of 7 and 8 (%) | ||||
Everthing else 5% |
Hi @Anonymous ,
Sales Forecast =
VAR SALESLY =
CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -1, YEAR ) )
VAR SALES2LY =
CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -2, YEAR ) )
VAR SALES3LY =
CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -3, YEAR ) )
VAR Factor =
SWITCH(
TRUE(),
MAX( Table[service] ) = "Managed Services", 1.07,
MAX( Table[service] ) = "Professional Services", 1.08,
1.05
)
RETURN
DIVIDE( SALESLY + SALES2LY + SALES3LY, 3, 0 ) * Factor
result:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try a measure like
Var Factor = 1.05
Return
Sumx( Values(Table[Product]) ,
DIVIDE(SALESLY+SALES2LY+SALES3LY,3,0)*Switch( True() ,
max(Table[Product]) = "managed Services" , 1.07,
max(Table[Product]) = "professional Service" , 1.08,
1.05) )
Hi Amit - getting no results back
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
87 | |
86 | |
68 | |
66 | |
64 |
User | Count |
---|---|
208 | |
120 | |
113 | |
79 | |
72 |