Forum Discussion

filiparibeiro's avatar
filiparibeiro
Helper III
3 years ago
Solved

Field Parameters and Measures

Hello.

I have created field parameters to change the graph's x axis in order to show information monthly, weekly and daily.

Now I would like to have a different measure for each of these situations without creating new field parameters for this.

So when the user selection is monthly it shows one measure, when selection is weekly it shows another etc.

Is this possible? How?

Many thanks.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  filiparibeiro ,

    I created some data:

     

    Here are the steps you can follow:

    1. Create measure.

    Month_Measure =
    SUMX(
        FILTER(ALL('Table'),
        'Table'[Group]="A"),[Value])
    Week_Measure =
    SUMX(
        FILTER(ALL('Table'),
        'Table'[Group]="B"),[Value])
    Measure =
    var _select=SELECTCOLUMNS('Parameter',"1",'Parameter'[Parameter])
    return
    SWITCH(
        TRUE(),
       "Month" in _select,[Month_Measure],
       "Week" in _select,[Week_Measure])

    2. Result:

    Select Week:

    Seelct Month:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  filiparibeiro ,

    I created some data:

     

    Here are the steps you can follow:

    1. Create measure.

    Month_Measure =
    SUMX(
        FILTER(ALL('Table'),
        'Table'[Group]="A"),[Value])
    Week_Measure =
    SUMX(
        FILTER(ALL('Table'),
        'Table'[Group]="B"),[Value])
    Measure =
    var _select=SELECTCOLUMNS('Parameter',"1",'Parameter'[Parameter])
    return
    SWITCH(
        TRUE(),
       "Month" in _select,[Month_Measure],
       "Week" in _select,[Week_Measure])

    2. Result:

    Select Week:

    Seelct Month:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly