aduguid's avatar
aduguid
Memorable Member
2 years ago

Dynamic Number Format

This can be used after selecting the "Dynamic" as the measure format under "Measure tools"

VAR CurrentValue = SELECTEDMEASURE()
RETURN
    SWITCH (
        TRUE (),
        // format the number based on value
        CurrentValue <= -1E6, "#,0,,.00 M",
        CurrentValue <= -1E3, "#,0,.00 K",
        CurrentValue <= 1E3, "#,0.00",
        CurrentValue < 1E6, "#,0,.00 K",
        CurrentValue < 1E9, "#,0,,.00 M",
        CurrentValue < 1E12, "#,0,,,.00 B"
    )

No RepliesBe the first to reply