Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Need help with DAX code, performance problem

See the description of the problem below, "Metric_to_Show" in the red box. As you can see I have one solution that is working fast if I use the actual metric, but when I replace the actual metric w...
  • Anonymous's avatar
    Anonymous
    5 years ago

    I have found the problem in the switch statement.
    After changing the switch statement to this, it is working.
    Metric to show:=
    SWITCH(
    SELECTEDVALUE(Dynamic_Metrics[Metric Name], "All/No selected"),
    "# of rows with Police dispatched by",[# of rows with Police dispatched by],
    "# of rows with Fire dispatched by",[# of rows with Fire dispatched by],
    "# of rows with Guard dispatched by",[# of rows with Guard dispatched by],
    "# of rows with Guard dispatched cancelled by",[# of rows with Guard dispatched cancelled by],
    "# of rows with Sms sent by",[# of rows with Sms sent by],
    "# of rows with First ACK by",[# of rows with First ACK by],
    [# of rows with Guard dispatched by]
    )