Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Multiplier depending on critera

Hello,

 

I would like to create a measure or column based off critera that will dicate to multiply a set of data or not. In the table below, I would like to multiply anything that has the channel of "Disty" by 6%. Any help would be great! Thank you!

 

ChannelCost
Direct $  100.00
Disty $  200.00
Disty $  100.00
Direct $  500.00
Disty $  600.00
  • Hey there Anonymous,

    What you need to do is create a DAX Calculated column. The formula should look like this:

    Column Name = If('Table'[Channel] = "Disty", 'Table'[Cost] * 1.06, 'Table'[Cost])

     


    If this is correct please think about marking it as a solution.

  • Syk's avatar
    Syk
    3 years ago

    Oh you're saying you just don't want the Direct cost? Only disty?

    Disty Cost = CALCULATE (
            SUM ( 'table'[cost] ),
            'table'[Channel] = "Disty"
        ) * 1.06

     

12 Replies

  • Hey there Anonymous,

    What you need to do is create a DAX Calculated column. The formula should look like this:

    Column Name = If('Table'[Channel] = "Disty", 'Table'[Cost] * 1.06, 'Table'[Cost])

     


    If this is correct please think about marking it as a solution.

    • Anonymous's avatar
      Anonymous
      Not applicable

      This works, but when I filter on other things in the report, it is multiplying all cost still instead of what is filtered. Anyway to get around this? For instance. If had the same table as above but added in one more column for filtering. Example below.

       

      CompanyChannelCost
      ADirect $  100.00
      BDisty $  200.00
      CDisty $  100.00
      ADirect $  500.00
      ADisty $  600.00
  • Syk's avatar
    Syk
    Resident Rockstar

     

    ___measure =
    VAR disty =
        CALCULATE (
            SUM ( 'table'[cost] ),
            'table'[Channel] = "Disty"
        ) * 1.06
    VAR other =
        CALCULATE (
            SUM ( 'table'[cost] ),
            'table'[Channel] <> "Disty"
        )
    RETURN
        other + disty
    

     

    Will this work for you?

    • Syk's avatar
      Syk
      Resident Rockstar

      Now you have a solution for a column or a measure! 

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Syk I tried your solution as well, and though it works in isolated instances. It also like the column doesn't work when I use certain filters. Any ideas how I get it to apply to when I filter?

      • Syk's avatar
        Syk
        Resident Rockstar

        Depends on your relationships and the filter.. Can you give an example?