Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION

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

View solution in original post

5 REPLIES 5
v-yuta-msft
Community Support
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
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.

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

Anonymous
Not applicable

Hi Jimmy Tao,

 

I've created a new table and its multiples. I even had to put it on a new page because I could not make it on same page as I am unable to write a conditional statement or DAX to make it show on same page .

I'd used the same DAX statement which works on page 1.

But the  multiples page 2 shows blank on selection of the slicers. I have tried making the relationships but still no success.

 

blank.png

I've sent the Pbix file to your inbox

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.