Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Dynamically multiply measures with different values

Hi,

 

Please Assist.

 

I have a set of values from measures which displays correctly .

And  I also have another slicer that flip between this values and the multiple of this values in the same graph.

 

I Created a parameter that gives the general value multiple for all the measures.  For now I multiplied all with 0.05 using the modelling tab “New Parameter” and got the below:

Parameter = GENERATESERIES(0.05, 1, 0.95)

But I need  the measures to have different parameter. Ie not all the measures are to be calculated same.

See the  DAX I got  that outputs the different measures on a graph when slicer is selected:

**************************************************************************************************************

TotalAgree =

IF (ISFILTERED(Parks[Park]),

   SWITCH(FIRSTNONBLANK(Parks[ParkNo],Parks[ParkNo]),

   "BOAT-A",[BOAT-A],

  "BOAT-B",[BOAT-B],

   "CAR-A",[CAR-A],

    "CAR-B",[CAR-B],

    "BIKE-A",[BIKE-A],

    “BIKE-B",[BIKE-B]

      ),

   BLANK())*'Parameter'[ModeValue]

 

This DAX works well by multiplying the entire measures with the Parameter Value 0.05..

But I want

"BOAT-A",[BOAT-A], and  "BOAT-B",[BOAT-B], to calculated by 0.08

   "CAR-A",[CAR-A], and   "CAR-B",[CAR-B], to be calculated by 0.06

And "BIKE-A",[BIKE-A] and    “BIKE-B",[BIKE-B] to be calculated by 0.07

 

 

Please Help

  • Hi ichebobo,

     

    I have analyzed your table, but I didn't find a relationship between table 'StationIDsCost' and 'A2011ConfigData', you should create a column in 'A2011ConfigData' and then create a relationship between the two table.

     

    Regards,

    Jimmy Tao

5 Replies

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

    Hi ichebobo,

     

    Modify your formula like this:

    TotalAgree =
    IF (
        ISFILTERED ( Parks[Park] ),
        SWITCH (
            FIRSTNONBLANK ( Parks[ParkNo], Parks[ParkNo] ),
            "BOAT-A", [BOAT-A] * 0.08,
            "BOAT-B", [BOAT-B] * 0.08,
            "CAR-A", [CAR-A] * 0.06,
            "CAR-B", [CAR-B] * 0.06,
            "BIKE-A", [BIKE-A] * 0.07,
            "BIKE-B", [BIKE-B] * 0.07
        ),
        BLANK ()
    )
    

    Regards,

    Jimmy Tao

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Jimmy Tao.

       

      The expression has jumped up the figures for the measure. 

      I expect to  multiply or make this rate 'active' only on the parameter of the measures.

      I've sent you the pbix through your email.

      Please have a look.

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

        Hi ichebobo,

         

        I'm afraid what-if parameter can't realize what you want because the value you selected in parameter slicer is single, not based on condition. As a workaround, you may create a new table which contains two columns [StationID] and its multiplied rate and create a slicer based on column [StationID] in the new table.

         

        Regards,

        Jimmy Tao