Forum Discussion

SeanI's avatar
SeanI
New Member
3 years ago
Solved

Multiple What-If Parameters slowing down model

Hi All!   I'm struggling with a recent model that uses multiple What if parameters to allow the user to forecast future employee head counts. My data table is a list of current employees that fall ...
  • Mikelytics's avatar
    3 years ago

    Hi SeanI 

     

    Can you please try to also put...

     

    SUM('Data Table'[Current Count]) 

     

    ... in a separate variable.

     

    It might be that in each measure this is calcualted multiple time instead of one time. So the formulal would look like:

     

    Year 1 =
    
    var var_Sum = SUM('Data Table'[Current Count])
    
    var CAExperienceHire
        = var_Sum +('CA Experienced Hire'[CA Experienced Hire Value])
    var CAIntern
        = var_Sum +('CA Intern'[CA Intern Value])
    var CANewHire
        = var_Sum +('CA New Hire'[CA New Hire Value])
    var CAProfessional
        = var_Sum +('CA Professional'[CA Professional Value])
    var CASemiPro
        = var_Sum +('CA Semi-Pro'[CA Semi-Pro Value])
    var CASubjectMatterExpert
        = var_Sum +('CA Subject Matter Expert'[CA Subject Matter Expert Value])
    
    Return 
    SWITCH(TRUE(),
        average('Data Table'[Mapping])=1,CAExperienceHire,
        average('Data Table'[Mapping])=2,CAIntern,
        average('Data Table'[Mapping])=3,CANewHire,
        average('Data Table'[Mapping])=4,CAProfessional,
        average('Data Table'[Mapping])=5,CASemiPro,
        average('Data Table'[Mapping])=6,CASubjectMatterExpert,var_Sum))

     

    So if I am right there should be less redundant calculation. But also if it does not speed up your measure it still simplifies it 🙂

     

    Best regards

    Michael

    -----------------------------------------------------

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

    @ me in replies or I'll lose your thread.