Forum Discussion

AlanP514's avatar
AlanP514
Post Patron
3 years ago
Solved

How to reduce values using dax

Hi all, 

I have a requirement, I want to reduce these big values using Dax, i am trying to the clicks rATE AND Variation for clicks(red marked), I want to reduce Variation(marked) to small expected output is down and i am attaching the Dax which i wrote it for creating Variation KPI


Expected Output

(-1.317)

 

 

_Unique clicks rate  KPI =
VAR _VariationPrecentage = [Unique Clicks rate variation %]
VAR _Variation = [Unique Clicks rate variation]

Return
COMBINEVALUES (
    " ",
    IF ( _VariationPrecentage > 0, [_UpArrow] , [_DownArrow] ),
    FORMAT ( _VariationPrecentage, [_Percentage Format] ),
    " (",
    _Variation,
    ")"
)



 

please help to find solution

  • HI AlanP514 ,

    Test like the below:

    test = format(MAX('Table'[index]),".000")

    Output result:

    Adjust your dax to :

    _Unique clicks rate  KPI =
    VAR _VariationPrecentage = [Unique Clicks rate variation %]
    VAR _Variation = format([Unique Clicks rate variation],".000"
    )
    Return
    COMBINEVALUES (
        " ",
        IF ( _VariationPrecentage > 0, [_UpArrow] , [_DownArrow] ),
        FORMAT ( _VariationPrecentage, [_Percentage Format] ),
        " (",
        _Variation,
        ")"
    )

    Refer:

    https://learn.microsoft.com/en-us/dax/format-function-dax 

     

    Best Regards

    Lucien

5 Replies

    • AlanP514's avatar
      AlanP514
      Post Patron

      Hai lbendlin 

      Actually it is just dummy , my expectation is from above marked big  value  to  4 number of values( down expected output)

       

      Can you please help me 

      • lbendlin's avatar
        lbendlin
        Super User

        Please provide sanitized sample data that fully covers your issue.
        Please show the expected outcome based on the sample data you provided.

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    HI AlanP514 ,

    Test like the below:

    test = format(MAX('Table'[index]),".000")

    Output result:

    Adjust your dax to :

    _Unique clicks rate  KPI =
    VAR _VariationPrecentage = [Unique Clicks rate variation %]
    VAR _Variation = format([Unique Clicks rate variation],".000"
    )
    Return
    COMBINEVALUES (
        " ",
        IF ( _VariationPrecentage > 0, [_UpArrow] , [_DownArrow] ),
        FORMAT ( _VariationPrecentage, [_Percentage Format] ),
        " (",
        _Variation,
        ")"
    )

    Refer:

    https://learn.microsoft.com/en-us/dax/format-function-dax 

     

    Best Regards

    Lucien