Forum Discussion

EsterBR's avatar
EsterBR
Helper II
2 years ago

Parameters - Measures

Hi,

 

I have created the following table with the parameter Q/Month:

 

When you select Quarter, the parameter shows the field Quarter and when you select Month the parameter shows the field Month in the columns.

 

I would like that in values when you select Quarter in the parameter, the values show the field Sales per Q and when you select Month the parameter shows the field SUM Sales. Is this possible? Thanks!

 

 

 

 

4 Replies

  • _AAndrade's avatar
    _AAndrade
    Resident Rockstar

    Hi,

    Do you want to change the names od the columns to Sales per Q and SUM Sales?

     

    • EsterBR's avatar
      EsterBR
      Helper II

      Hi _AAndrade,

       

      I would like that when Quarter is selected in the parameter, the measure shown in values is "Sales per Q" and when Month is selected in the parameter, the measure shown in values is "SUM Sales". Both measures are already created in the report. 

       

      Thanks

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

    Hi all , 

    _AAndrade , thanks for your concern about this case, I have some additions for problem solving.

    EsterBR , thank you for giving a specific description of the problem. Based on your description, I will give you the following steps to solve the problem.

    1.The test table Table.

    2.New parameter as the picture.

    3.New measure Average/Sum and input:

     

     

    Average/Sum = 
    If(SELECTEDVALUE('Parameter Q/Month'[Parameter Q/Month Order]),SUM('Table'[Sales]),AVERAGE('Table'[Sales]))
    

     

    4.Add Region to Rows, add Parameter Q/Month to Columns, add Average/Sum to Values.

    5.The outcome is in the following pictures.

    You can modify the above DAX codes according to your needs.

     

     

    Best Regards,

    Caroline Mei

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